Changeset 198:d6cc0579b94b in glemon-0.x
- Timestamp:
- 03/01/07 17:28:13 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@3211
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
eps_win.cc
r196 r198 18 18 19 19 #include <eps_win.h> 20 21 #include <mapselector.h> 22 20 23 #include <set> 21 24 … … 29 32 } 30 33 31 EpsWin::EpsWin(const std::string& title ):Gtk::Dialog(title, true, true)34 EpsWin::EpsWin(const std::string& title, std::vector<std::string> nml):Gtk::Dialog(title, true, true) 32 35 { 33 36 set_default_size(200, 50); … … 55 58 } 56 59 60 mapselector=new MapSelector(nml, "", "Nodeshapes", false); 61 mapselector->signal_newmapwin_needed().connect(sigc::mem_fun(*this, &EpsWin::newMapWinNeeded)); 62 57 63 hbox.pack_start(*(new Gtk::Label("Filename"))); 58 64 hbox.pack_start(name); … … 61 67 62 68 vbox->pack_start(*table); 69 vbox->pack_start(*mapselector); 63 70 vbox->pack_start(hbox); 64 71 … … 88 95 values[i]=options[i]->get_active(); 89 96 } 90 signal_eps_details.emit(values, name.get_text() );97 signal_eps_details.emit(values, name.get_text(), mapselector->get_active_text()); 91 98 } 92 99 on_delete_event(NULL); 93 100 } 101 102 void EpsWin::newMapWinNeeded(bool isitedge) 103 { 104 signal_new_map.emit(false); 105 } 106 107 void EpsWin::registerNewNodeMap(std::string newmapname) 108 { 109 mapselector->append_text((Glib::ustring)newmapname); 110 } -
eps_win.h
r196 r198 19 19 #ifndef EPS_WIN_H 20 20 #define EPS_WIN_H 21 22 class MapSelector; 21 23 22 24 #include <all_include.h> … … 50 52 Gtk::Entry name; 51 53 54 MapSelector * mapselector; 52 55 public: 53 56 ///Constructor … … 59 62 ///\param nml nodemap list 60 63 ///\param mw the owner \ref NoteBookTab (\ref mytab) 61 EpsWin(const std::string& title );64 EpsWin(const std::string& title, std::vector<std::string>); 62 65 63 66 ///Deregistrates \ref EpsWin in its \ref NoteBookTab (\ref mytab) … … 76 79 77 80 ///indicates that user is ready to export EPS file 78 sigc::signal<void, std::vector<bool>, std::string > signal_eps_details;81 sigc::signal<void, std::vector<bool>, std::string, std::string > signal_eps_details; 79 82 80 83 ///returns \ref signal_eps_details 81 sigc::signal<void, std::vector<bool>, std::string > signal_eps_details_ch(){return signal_eps_details;};84 sigc::signal<void, std::vector<bool>, std::string, std::string > signal_eps_details_ch(){return signal_eps_details;}; 82 85 83 86 ///indicates that the windows can be closed … … 87 90 sigc::signal<void> signal_eps_close_ch(){return signal_eps_close;}; 88 91 92 ///indicates that the windows can be closed 93 sigc::signal<void, bool> signal_new_map; 89 94 95 ///returns \ref signal_eps_close 96 sigc::signal<void, bool> signal_new_map_ch(){return signal_new_map;}; 97 98 ///Function is called when new map is required. 99 void newMapWinNeeded(bool); 100 101 ///This function inserts name of the new nodemap in the name list in \ref MapSelector s 102 103 ///\param new_name 104 ///name of new map 105 void registerNewNodeMap(std::string new_name); 90 106 }; 91 107 -
mapstorage.cc
r195 r198 592 592 } 593 593 594 void MapStorage::exportGraphToEPS(std::vector<bool> options, std::string filename) 595 { 594 void MapStorage::exportGraphToEPS(std::vector<bool> options, std::string filename, std::string shapemap) 595 { 596 Graph::NodeMap<int> _shapes(graph, 0); 596 597 Graph::NodeMap<int> _nodeColors(graph, 0); 597 598 Graph::EdgeMap<int> _edgeColors(graph, 0); … … 643 644 } 644 645 } 646 if(shapemap!="") 647 { 648 if((minOfNodeMap(shapemap)>=0)&&(maxOfNodeMap(shapemap)<=4)) 649 { 650 _shapes=*(nodemap_storage[shapemap]); 651 } 652 } 645 653 646 654 Palette palette; … … 653 661 nodeScale(2).nodeSizes(_nodeSizes). 654 662 coords(coords). 663 nodeShapes(_shapes). 655 664 nodeColors(composeMap(paletteW,_nodeColors)). 656 665 edgeColors(composeMap(palette,_edgeColors)). 657 666 edgeWidthScale(0.3).edgeWidths(_edgeWidths). 658 667 nodeTexts(_nodeTextMap).nodeTextSize(7). 659 enableParallel(_enableParallel).parEdgeDist( 4).668 enableParallel(_enableParallel).parEdgeDist(5). 660 669 drawArrows(_drawArrows).arrowWidth(7).arrowLength(7). 661 670 run(); -
mapstorage.h
r195 r198 295 295 void redesign_data_changed(); 296 296 297 void exportGraphToEPS(std::vector<bool>, std::string );297 void exportGraphToEPS(std::vector<bool>, std::string, std::string); 298 298 }; 299 299 -
nbtab.cc
r197 r198 224 224 mapwin->registerNewNodeMap(mapname); 225 225 } 226 if(epswinexists) 227 { 228 epswin->registerNewNodeMap(mapname); 229 } 226 230 } 227 231 … … 241 245 if(!epswinexists) 242 246 { 243 epswin=new EpsWin("Export to EPS - "+name );247 epswin=new EpsWin("Export to EPS - "+name, mapstorage->getNodeMapList()); 244 248 epswin->show(); 245 249 epswinexists=true; 246 250 epswin->signal_eps_details_ch().connect(sigc::mem_fun(*this, &NoteBookTab::exportGraphToEPS)); 247 251 epswin->signal_eps_close_ch().connect(sigc::mem_fun(*this, &NoteBookTab::closeEpsWin)); 252 epswin->signal_new_map_ch().connect(sigc::mem_fun(*this, &NoteBookTab::popupNewMapWin)); 248 253 } 249 254 } … … 321 326 } 322 327 323 void NoteBookTab::exportGraphToEPS(std::vector<bool> options, std::string filename )324 { 325 mapstorage->exportGraphToEPS(options, filename );328 void NoteBookTab::exportGraphToEPS(std::vector<bool> options, std::string filename, std::string shapemap) 329 { 330 mapstorage->exportGraphToEPS(options, filename, shapemap); 326 331 } 327 332 -
nbtab.h
r196 r198 229 229 230 230 ///Lets Mapstorage export the graph to EPS 231 void exportGraphToEPS(std::vector<bool>, std::string );231 void exportGraphToEPS(std::vector<bool>, std::string, std::string); 232 232 233 233 ///\ref MapWin calls this function when it updates the maplist in comboboxes.
Note: See TracChangeset
for help on using the changeset viewer.