COIN-OR::LEMON - Graph Library

source: glemon-0.x/dijkstrabox.h @ 173:8339178ae43d

Last change on this file since 173:8339178ae43d was 165:2cd447b0bd3a, checked in by Hegyi Péter, 13 years ago

Suurballe algorithm is implemented in glemon.

File size: 1.7 KB
Line 
1// -*- C++ -*- //
2
3#ifndef DIJKSTRABOX_H
4#define DIJKSTRABOX_H
5
6class DijkstraBox;
7
8#include <all_include.h>
9#include <algobox.h>
10#include <libgnomecanvasmm.h>
11#include <libgnomecanvasmm/polygon.h>
12
13///Graphical interface to run Dijkstra algorithm.
14
15///Child of \ref AlgoBox,
16///therefore the only task to do at implementation was to
17///
18///-call init function with correct parameters from correctly parametrized constructor
19///
20///-implement \ref build_box function
21///
22///-implement \ref run function
23class DijkstraBox : public AlgoBox
24{
25protected:
26  ///Shows result of Dijkstra algorithm
27  Gtk::Label resultlabel;
28
29
30  ///Table for nodeselector widgets
31  Gtk::Table table;
32
33  ///Combobox for select source node
34  Gtk::ComboBoxText source;
35
36  ///Combobox for select target node
37  Gtk::ComboBoxText target;
38
39  ///Gets to and from node from combobox
40  void get_from_to(Node &, Node &, Graph &);
41
42public:
43  ///Calls \ref AlgoBox::init function to initialize class properly, automatically.
44  DijkstraBox(std::vector<std::string> t);
45
46  ///Prepare, run and postprocess Dijkstra algorithm.
47
48  ///\ref glemon works only with maps filled with double values
49  ///at the moment. While Dijkstra nedds a bool map as output.
50  ///As postprocess this bool map should be transformed to
51  ///double map.
52  virtual void run();
53
54  ///Builds the graphical design of the interface.
55  virtual void build_box();
56
57  void maplists_updated();
58};
59
60class SuurballeBox : public DijkstraBox
61{
62  ///number of paths to find
63  int num;
64 
65  ///Widget to set numbewr of paths to find
66  Gtk::SpinButton * num_set;
67
68  ///Holder widget
69  Gtk::HBox hbox;
70
71public:
72  SuurballeBox(std::vector<std::string> t);
73  void run();
74  void build_box();
75};
76#endif //DIJKSTRABOX_H
Note: See TracBrowser for help on using the repository browser.