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