[174] | 1 | /* -*- C++ -*- |
---|
| 2 | * |
---|
| 3 | * This file is a part of LEMON, a generic C++ optimization library |
---|
| 4 | * |
---|
| 5 | * Copyright (C) 2003-2006 |
---|
| 6 | * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
---|
| 7 | * (Egervary Research Group on Combinatorial Optimization, EGRES). |
---|
| 8 | * |
---|
| 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. |
---|
| 12 | * |
---|
| 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 |
---|
| 15 | * purpose. |
---|
| 16 | * |
---|
| 17 | */ |
---|
[163] | 18 | |
---|
| 19 | #ifndef DIJKSTRABOX_H |
---|
| 20 | #define DIJKSTRABOX_H |
---|
| 21 | |
---|
| 22 | class DijkstraBox; |
---|
| 23 | |
---|
| 24 | #include <all_include.h> |
---|
| 25 | #include <algobox.h> |
---|
| 26 | #include <libgnomecanvasmm.h> |
---|
| 27 | #include <libgnomecanvasmm/polygon.h> |
---|
| 28 | |
---|
| 29 | ///Graphical interface to run Dijkstra algorithm. |
---|
| 30 | |
---|
| 31 | ///Child of \ref AlgoBox, |
---|
| 32 | ///therefore the only task to do at implementation was to |
---|
| 33 | /// |
---|
| 34 | ///-call init function with correct parameters from correctly parametrized constructor |
---|
| 35 | /// |
---|
| 36 | ///-implement \ref build_box function |
---|
| 37 | /// |
---|
| 38 | ///-implement \ref run function |
---|
| 39 | class DijkstraBox : public AlgoBox |
---|
| 40 | { |
---|
[165] | 41 | protected: |
---|
[163] | 42 | ///Shows result of Dijkstra algorithm |
---|
| 43 | Gtk::Label resultlabel; |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | ///Table for nodeselector widgets |
---|
| 47 | Gtk::Table table; |
---|
| 48 | |
---|
| 49 | ///Combobox for select source node |
---|
| 50 | Gtk::ComboBoxText source; |
---|
| 51 | |
---|
| 52 | ///Combobox for select target node |
---|
| 53 | Gtk::ComboBoxText target; |
---|
| 54 | |
---|
[165] | 55 | ///Gets to and from node from combobox |
---|
| 56 | void get_from_to(Node &, Node &, Graph &); |
---|
| 57 | |
---|
[163] | 58 | public: |
---|
| 59 | ///Calls \ref AlgoBox::init function to initialize class properly, automatically. |
---|
| 60 | DijkstraBox(std::vector<std::string> t); |
---|
| 61 | |
---|
| 62 | ///Prepare, run and postprocess Dijkstra algorithm. |
---|
| 63 | |
---|
| 64 | ///\ref glemon works only with maps filled with double values |
---|
| 65 | ///at the moment. While Dijkstra nedds a bool map as output. |
---|
| 66 | ///As postprocess this bool map should be transformed to |
---|
| 67 | ///double map. |
---|
[165] | 68 | virtual void run(); |
---|
[163] | 69 | |
---|
| 70 | ///Builds the graphical design of the interface. |
---|
[165] | 71 | virtual void build_box(); |
---|
[163] | 72 | |
---|
| 73 | void maplists_updated(); |
---|
| 74 | }; |
---|
[165] | 75 | |
---|
| 76 | class SuurballeBox : public DijkstraBox |
---|
| 77 | { |
---|
| 78 | ///number of paths to find |
---|
| 79 | int num; |
---|
| 80 | |
---|
| 81 | ///Widget to set numbewr of paths to find |
---|
| 82 | Gtk::SpinButton * num_set; |
---|
| 83 | |
---|
| 84 | ///Holder widget |
---|
| 85 | Gtk::HBox hbox; |
---|
| 86 | |
---|
| 87 | public: |
---|
| 88 | SuurballeBox(std::vector<std::string> t); |
---|
| 89 | void run(); |
---|
| 90 | void build_box(); |
---|
| 91 | }; |
---|
[163] | 92 | #endif //DIJKSTRABOX_H |
---|