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