1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/dijkstrabox.h Mon Jul 07 08:10:39 2008 -0500
1.3 @@ -0,0 +1,91 @@
1.4 +/* -*- C++ -*-
1.5 + *
1.6 + * This file is a part of LEMON, a generic C++ optimization library
1.7 + *
1.8 + * Copyright (C) 2003-2006
1.9 + * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
1.10 + * (Egervary Research Group on Combinatorial Optimization, EGRES).
1.11 + *
1.12 + * Permission to use, modify and distribute this software is granted
1.13 + * provided that this copyright notice appears in all copies. For
1.14 + * precise terms see the accompanying LICENSE file.
1.15 + *
1.16 + * This software is provided "AS IS" with no warranty of any kind,
1.17 + * express or implied, and with no claim as to its suitability for any
1.18 + * purpose.
1.19 + *
1.20 + */
1.21 +
1.22 +#ifndef DIJKSTRABOX_H
1.23 +#define DIJKSTRABOX_H
1.24 +
1.25 +class AlgoBox;
1.26 +
1.27 +#include <all_include.h>
1.28 +#include <libgnomecanvasmm.h>
1.29 +#include <libgnomecanvasmm/polygon.h>
1.30 +
1.31 +///Digraphical interface to run Dijkstra algorithm.
1.32 +
1.33 +///Child of \ref AlgoBox,
1.34 +///therefore the only task to do at implementation was to
1.35 +///
1.36 +///-call init function with correct parameters from correctly parametrized constructor
1.37 +///
1.38 +///-implement \ref build_box function
1.39 +///
1.40 +///-implement \ref run function
1.41 +class DijkstraBox : public AlgoBox
1.42 +{
1.43 +protected:
1.44 + ///Shows result of Dijkstra algorithm
1.45 + Gtk::Label resultlabel;
1.46 +
1.47 +
1.48 + ///Table for nodeselector widgets
1.49 + Gtk::Table table;
1.50 +
1.51 + ///Combobox for select source node
1.52 + Gtk::ComboBoxText source;
1.53 +
1.54 + ///Combobox for select target node
1.55 + Gtk::ComboBoxText target;
1.56 +
1.57 + ///Gets to and from node from combobox
1.58 + void get_from_to(Node &, Node &, Digraph &);
1.59 +
1.60 +public:
1.61 + ///Calls \ref AlgoBox::init function to initialize class properly, automatically.
1.62 + DijkstraBox(std::vector<std::string> t);
1.63 +
1.64 + ///Prepare, run and postprocess Dijkstra algorithm.
1.65 +
1.66 + ///\ref glemon works only with maps filled with double values
1.67 + ///at the moment. While Dijkstra nedds a bool map as output.
1.68 + ///As postprocess this bool map should be transformed to
1.69 + ///double map.
1.70 + virtual void run();
1.71 +
1.72 + ///Builds the digraphical design of the interface.
1.73 + virtual void build_box();
1.74 +
1.75 + void maplists_updated();
1.76 +};
1.77 +
1.78 +class SuurballeBox : public DijkstraBox
1.79 +{
1.80 + ///number of paths to find
1.81 + int num;
1.82 +
1.83 + ///Widget to set numbewr of paths to find
1.84 + Gtk::SpinButton * num_set;
1.85 +
1.86 + ///Holder widget
1.87 + Gtk::HBox hbox;
1.88 +
1.89 +public:
1.90 + SuurballeBox(std::vector<std::string> t);
1.91 + void run();
1.92 + void build_box();
1.93 +};
1.94 +#endif //DIJKSTRABOX_H