dijkstrabox.h
author hegyi
Wed, 25 Oct 2006 13:21:24 +0000
changeset 172 fc1e478697d3
parent 163 443bc769b344
child 174 95872af46fc4
permissions -rw-r--r--
Currently visualized map can be saved and loaded from file.
     1 // -*- C++ -*- //
     2 
     3 #ifndef DIJKSTRABOX_H
     4 #define DIJKSTRABOX_H
     5 
     6 class 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
    23 class DijkstraBox : public AlgoBox
    24 {
    25 protected:
    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 
    42 public:
    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 
    60 class 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 
    71 public:
    72   SuurballeBox(std::vector<std::string> t);
    73   void run();
    74   void build_box();
    75 };
    76 #endif //DIJKSTRABOX_H