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