alpar@174: /* -*- C++ -*- alpar@174: * alpar@174: * This file is a part of LEMON, a generic C++ optimization library alpar@174: * alpar@174: * Copyright (C) 2003-2006 alpar@174: * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport alpar@174: * (Egervary Research Group on Combinatorial Optimization, EGRES). alpar@174: * alpar@174: * Permission to use, modify and distribute this software is granted alpar@174: * provided that this copyright notice appears in all copies. For alpar@174: * precise terms see the accompanying LICENSE file. alpar@174: * alpar@174: * This software is provided "AS IS" with no warranty of any kind, alpar@174: * express or implied, and with no claim as to its suitability for any alpar@174: * purpose. alpar@174: * alpar@174: */ hegyi@163: hegyi@163: #ifndef DIJKSTRABOX_H hegyi@163: #define DIJKSTRABOX_H hegyi@163: hegyi@163: class DijkstraBox; hegyi@163: hegyi@163: #include hegyi@163: #include hegyi@163: #include hegyi@163: #include hegyi@163: hegyi@163: ///Graphical interface to run Dijkstra algorithm. hegyi@163: hegyi@163: ///Child of \ref AlgoBox, hegyi@163: ///therefore the only task to do at implementation was to hegyi@163: /// hegyi@163: ///-call init function with correct parameters from correctly parametrized constructor hegyi@163: /// hegyi@163: ///-implement \ref build_box function hegyi@163: /// hegyi@163: ///-implement \ref run function hegyi@163: class DijkstraBox : public AlgoBox hegyi@163: { hegyi@165: protected: hegyi@163: ///Shows result of Dijkstra algorithm hegyi@163: Gtk::Label resultlabel; hegyi@163: hegyi@163: hegyi@163: ///Table for nodeselector widgets hegyi@163: Gtk::Table table; hegyi@163: hegyi@163: ///Combobox for select source node hegyi@163: Gtk::ComboBoxText source; hegyi@163: hegyi@163: ///Combobox for select target node hegyi@163: Gtk::ComboBoxText target; hegyi@163: hegyi@165: ///Gets to and from node from combobox hegyi@165: void get_from_to(Node &, Node &, Graph &); hegyi@165: hegyi@163: public: hegyi@163: ///Calls \ref AlgoBox::init function to initialize class properly, automatically. hegyi@163: DijkstraBox(std::vector t); hegyi@163: hegyi@163: ///Prepare, run and postprocess Dijkstra algorithm. hegyi@163: hegyi@163: ///\ref glemon works only with maps filled with double values hegyi@163: ///at the moment. While Dijkstra nedds a bool map as output. hegyi@163: ///As postprocess this bool map should be transformed to hegyi@163: ///double map. hegyi@165: virtual void run(); hegyi@163: hegyi@163: ///Builds the graphical design of the interface. hegyi@165: virtual void build_box(); hegyi@163: hegyi@163: void maplists_updated(); hegyi@163: }; hegyi@165: hegyi@165: class SuurballeBox : public DijkstraBox hegyi@165: { hegyi@165: ///number of paths to find hegyi@165: int num; hegyi@165: hegyi@165: ///Widget to set numbewr of paths to find hegyi@165: Gtk::SpinButton * num_set; hegyi@165: hegyi@165: ///Holder widget hegyi@165: Gtk::HBox hbox; hegyi@165: hegyi@165: public: hegyi@165: SuurballeBox(std::vector t); hegyi@165: void run(); hegyi@165: void build_box(); hegyi@165: }; hegyi@163: #endif //DIJKSTRABOX_H