dijkstrabox.h
author hegyi
Wed, 28 Feb 2007 18:20:28 +0000
changeset 194 6b2b718420eb
parent 174 95872af46fc4
permissions -rw-r--r--
Header reorganising
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@194
    22
class AlgoBox;
hegyi@163
    23
hegyi@163
    24
#include <all_include.h>
hegyi@163
    25
#include <libgnomecanvasmm.h>
hegyi@163
    26
#include <libgnomecanvasmm/polygon.h>
hegyi@163
    27
hegyi@163
    28
///Graphical interface to run Dijkstra algorithm.
hegyi@163
    29
hegyi@163
    30
///Child of \ref AlgoBox,
hegyi@163
    31
///therefore the only task to do at implementation was to
hegyi@163
    32
///
hegyi@163
    33
///-call init function with correct parameters from correctly parametrized constructor
hegyi@163
    34
///
hegyi@163
    35
///-implement \ref build_box function
hegyi@163
    36
///
hegyi@163
    37
///-implement \ref run function
hegyi@163
    38
class DijkstraBox : public AlgoBox
hegyi@163
    39
{
hegyi@165
    40
protected:
hegyi@163
    41
  ///Shows result of Dijkstra algorithm
hegyi@163
    42
  Gtk::Label resultlabel;
hegyi@163
    43
hegyi@163
    44
hegyi@163
    45
  ///Table for nodeselector widgets
hegyi@163
    46
  Gtk::Table table;
hegyi@163
    47
hegyi@163
    48
  ///Combobox for select source node
hegyi@163
    49
  Gtk::ComboBoxText source;
hegyi@163
    50
hegyi@163
    51
  ///Combobox for select target node
hegyi@163
    52
  Gtk::ComboBoxText target;
hegyi@163
    53
hegyi@165
    54
  ///Gets to and from node from combobox
hegyi@165
    55
  void get_from_to(Node &, Node &, Graph &);
hegyi@165
    56
hegyi@163
    57
public:
hegyi@163
    58
  ///Calls \ref AlgoBox::init function to initialize class properly, automatically.
hegyi@163
    59
  DijkstraBox(std::vector<std::string> t);
hegyi@163
    60
hegyi@163
    61
  ///Prepare, run and postprocess Dijkstra algorithm.
hegyi@163
    62
hegyi@163
    63
  ///\ref glemon works only with maps filled with double values
hegyi@163
    64
  ///at the moment. While Dijkstra nedds a bool map as output.
hegyi@163
    65
  ///As postprocess this bool map should be transformed to
hegyi@163
    66
  ///double map.
hegyi@165
    67
  virtual void run();
hegyi@163
    68
hegyi@163
    69
  ///Builds the graphical design of the interface.
hegyi@165
    70
  virtual void build_box();
hegyi@163
    71
hegyi@163
    72
  void maplists_updated();
hegyi@163
    73
};
hegyi@165
    74
hegyi@165
    75
class SuurballeBox : public DijkstraBox
hegyi@165
    76
{
hegyi@165
    77
  ///number of paths to find
hegyi@165
    78
  int num;
hegyi@165
    79
  
hegyi@165
    80
  ///Widget to set numbewr of paths to find
hegyi@165
    81
  Gtk::SpinButton * num_set;
hegyi@165
    82
hegyi@165
    83
  ///Holder widget
hegyi@165
    84
  Gtk::HBox hbox;
hegyi@165
    85
hegyi@165
    86
public:
hegyi@165
    87
  SuurballeBox(std::vector<std::string> t);
hegyi@165
    88
  void run();
hegyi@165
    89
  void build_box();
hegyi@165
    90
};
hegyi@163
    91
#endif //DIJKSTRABOX_H