[174] | 1 | /* -*- C++ -*- |
---|
| 2 | * |
---|
| 3 | * This file is a part of LEMON, a generic C++ optimization library |
---|
| 4 | * |
---|
| 5 | * Copyright (C) 2003-2006 |
---|
| 6 | * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
---|
| 7 | * (Egervary Research Group on Combinatorial Optimization, EGRES). |
---|
| 8 | * |
---|
| 9 | * Permission to use, modify and distribute this software is granted |
---|
| 10 | * provided that this copyright notice appears in all copies. For |
---|
| 11 | * precise terms see the accompanying LICENSE file. |
---|
| 12 | * |
---|
| 13 | * This software is provided "AS IS" with no warranty of any kind, |
---|
| 14 | * express or implied, and with no claim as to its suitability for any |
---|
| 15 | * purpose. |
---|
| 16 | * |
---|
| 17 | */ |
---|
[6] | 18 | |
---|
| 19 | #ifndef MAP_WIN_H |
---|
| 20 | #define MAP_WIN_H |
---|
| 21 | |
---|
[194] | 22 | class NoteBookTab; |
---|
| 23 | class MapSelector; |
---|
[28] | 24 | |
---|
[94] | 25 | #include <all_include.h> |
---|
[6] | 26 | #include <libgnomecanvasmm.h> |
---|
| 27 | #include <libgnomecanvasmm/polygon.h> |
---|
| 28 | |
---|
[123] | 29 | ///Graph visualization setup window. |
---|
| 30 | |
---|
[6] | 31 | ///This class is responsible for creating a window, |
---|
| 32 | ///on which the visualization attributes can be |
---|
| 33 | ///assigned to maps. |
---|
| 34 | class MapWin : public Gtk::Window |
---|
| 35 | { |
---|
| 36 | protected: |
---|
[123] | 37 | ///\ref NoteBookTab to that the \ref MapWin belongs to. |
---|
[96] | 38 | NoteBookTab & mytab; |
---|
[6] | 39 | |
---|
[123] | 40 | ///Designing element |
---|
[28] | 41 | Gtk::Table * table; |
---|
[6] | 42 | |
---|
[123] | 43 | ///\ref MapSelectors for each property |
---|
[6] | 44 | |
---|
[123] | 45 | ///Each property has an own \ref MapSelector through which |
---|
| 46 | ///the map to visualize by the property van be set. |
---|
| 47 | MapSelector ** e_combo_array; |
---|
| 48 | |
---|
| 49 | ///\ref MapSelectors for each property |
---|
| 50 | |
---|
| 51 | ///Each property has an own \ref MapSelector through which |
---|
| 52 | ///the map to visualize by the property van be set. |
---|
| 53 | MapSelector ** n_combo_array; |
---|
| 54 | |
---|
| 55 | ///Information holder |
---|
[8] | 56 | Gtk::Label * label; |
---|
[6] | 57 | |
---|
[123] | 58 | ///Container in which elements are organized. |
---|
[28] | 59 | Gtk::VBox vbox; |
---|
| 60 | |
---|
[6] | 61 | public: |
---|
[123] | 62 | ///Constructor |
---|
[6] | 63 | |
---|
[123] | 64 | ///It creates the widgets shown in \ref MapWin and |
---|
| 65 | ///binds the needed signal to the correct place. |
---|
| 66 | ///\param title title of window |
---|
| 67 | ///\param eml edgemap list |
---|
| 68 | ///\param nml nodemap list |
---|
| 69 | ///\param mw the owner \ref NoteBookTab (\ref mytab) |
---|
| 70 | MapWin(const std::string& title, std::vector<std::string> eml, std::vector<std::string> nml, NoteBookTab & mw); |
---|
[95] | 71 | |
---|
[123] | 72 | ///Deregistrates \ref MapWin in its \ref NoteBookTab (\ref mytab) |
---|
[95] | 73 | virtual bool on_delete_event(GdkEventAny *); |
---|
| 74 | |
---|
[123] | 75 | ///Handles changement in nodemap selection |
---|
[28] | 76 | |
---|
[123] | 77 | ///If \ref MapSelector emits a signal that indicates |
---|
| 78 | ///changement in nodemap selection this function will |
---|
| 79 | ///be called. It calls the appropriate handler function, |
---|
| 80 | ///\ref NoteBookTab::propertyChange with parameters describing the changement. |
---|
| 81 | ///\param mapname the recently selected map |
---|
| 82 | ///\param prop the changed property |
---|
| 83 | void nodeMapChanged(std::string mapname, int prop); |
---|
[94] | 84 | |
---|
[123] | 85 | ///Handles changement in edgemap selection |
---|
[28] | 86 | |
---|
[123] | 87 | ///If \ref MapSelector emits a signal that indicates |
---|
| 88 | ///changement in edgemap selection this function will |
---|
| 89 | ///be called. It calls the appropriate handler function, |
---|
| 90 | ///\ref NoteBookTab::propertyChange with parameters describing the changement. |
---|
| 91 | ///\param mapname the recently selected map |
---|
| 92 | ///\param prop the changed property |
---|
| 93 | void edgeMapChanged(std::string mapname, int prop); |
---|
[38] | 94 | |
---|
[123] | 95 | ///Indicates to the owner \ref NoteBookTab that a \ref NewMapWin should be opened. |
---|
[38] | 96 | |
---|
[123] | 97 | ///This function is bound to the |
---|
| 98 | ///signal emitted by the \ref MapSelector in case of |
---|
| 99 | ///the user wants to create a new map. It only pass the |
---|
| 100 | ///information further to the tab owning this \ref MapWin that is needed to open the |
---|
| 101 | ///\ref NewMapWin. (\ref NoteBookTab::popupNewMapWin) |
---|
| 102 | ///\param itisedge should the new map will be an edgemap? (or nodemap) |
---|
| 103 | void newMapWinNeeded(bool itisedge); |
---|
| 104 | |
---|
| 105 | ///This function inserts name of the new edgemap in the name list in \ref MapSelector s |
---|
| 106 | |
---|
| 107 | ///\param new_name |
---|
| 108 | ///name of new map |
---|
| 109 | void registerNewEdgeMap(std::string new_name); |
---|
| 110 | |
---|
| 111 | ///This function inserts name of the new nodemap in the name list in \ref MapSelector s |
---|
| 112 | |
---|
| 113 | ///\param new_name |
---|
| 114 | ///name of new map |
---|
| 115 | void registerNewNodeMap(std::string new_name); |
---|
| 116 | |
---|
| 117 | ///Close window if Esc key pressed. |
---|
[30] | 118 | virtual bool closeIfEscapeIsPressed(GdkEventKey*); |
---|
[38] | 119 | |
---|
[123] | 120 | ///Updates list of maps in all \ref MapSelector |
---|
| 121 | |
---|
| 122 | ///This function is called by \ref NoteBookTab, when the file |
---|
| 123 | ///showed in it has changed, therefore the contained maps |
---|
| 124 | ///have changed as well. \ref NoteBookTab knows, whether it |
---|
| 125 | ///has to call this function or not from the \ref NoteBookTab::mapwinexists |
---|
| 126 | ///variable. |
---|
| 127 | ///\param eml edge map list |
---|
| 128 | ///\param nml node map list |
---|
| 129 | void update(std::vector<std::string> eml, std::vector<std::string> nml); |
---|
[172] | 130 | |
---|
| 131 | void changeEntry(bool, int, std::string); |
---|
| 132 | |
---|
| 133 | void set_title(std::string); |
---|
[6] | 134 | }; |
---|
| 135 | |
---|
| 136 | #endif //MAP_WIN_H |
---|