Changeset 177:40f3006fba2e in glemon-0.x
- Timestamp:
- 10/30/06 15:57:48 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@3032
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
design_win.cc
r174 r177 90 90 Gtk::Window::set_title("Design Setup - "+tabname); 91 91 } 92 93 void DesignWin::set_data(double attr, double propuls, int it) 94 { 95 attraction->set_value(attr); 96 propulsation->set_value(propuls); 97 iteration->set_value(it); 98 } -
design_win.h
r174 r177 64 64 65 65 void set_title(std::string); 66 67 void set_data(double, double, int); 66 68 }; 67 69 #endif //DESWIN_H -
graph_displayer_canvas.cc
r174 r177 26 26 isbutton(0), active_item(NULL), target_item(NULL), nodemap_to_edit(""), 27 27 edgemap_to_edit(""), autoscale(true), zoomtrack(false), radius_size(20), edge_width(10), 28 iterations(20), attraction(0.05), propulsation(40000),was_redesigned(false), is_drawn(false), mytab(mainw)28 was_redesigned(false), is_drawn(false), mytab(mainw) 29 29 { 30 30 //base event handler is move tool … … 305 305 was_redesigned=true; 306 306 } 307 307 308 double attraction; 309 double propulsation; 310 int iterations; 311 312 (mytab.mapstorage).get_design_data(attraction, propulsation, iterations); 308 313 309 314 //iteration counter … … 394 399 } 395 400 396 void GraphDisplayerCanvas::get_design_data(double & attraction_p, double & propulsation_p, int & iterations_p)397 {398 attraction_p=attraction;399 propulsation_p=propulsation;400 iterations_p=iterations;401 }402 403 void GraphDisplayerCanvas::set_attraction(double attraction_p)404 {405 attraction=attraction_p;406 }407 408 void GraphDisplayerCanvas::set_propulsation(double propulsation_p)409 {410 propulsation=propulsation_p;411 }412 413 void GraphDisplayerCanvas::set_iteration(int iterations_p)414 {415 iterations=iterations_p;416 }417 -
graph_displayer_canvas.h
r174 r177 337 337 void reDesignGraph(); 338 338 339 void get_design_data(double &, double &, int &);340 void set_attraction(double);341 void set_propulsation(double);342 void set_iteration(int);343 344 339 ///Show whether the graph is already drawn. 345 340 bool is_drawn; … … 429 424 double edge_width; 430 425 431 ///Iteration number during graph design432 int iterations;433 434 ///Attraction factor during graph design435 double attraction;436 437 ///Propulsation factor during graph design438 double propulsation;439 440 426 ///Was redesign run on this graph already? 441 427 /// -
gui_reader.cc
r176 r177 61 61 mapstorage->changeActiveMap(true, i, em[i]); 62 62 } 63 64 double attraction; 65 double propulsation; 66 int iteration; 67 68 x("redesign-attraction", attraction); 69 x("redesign-propulsation", propulsation); 70 x("redesign-iteration", iteration); 71 72 mapstorage->set_attraction(attraction); 73 mapstorage->set_propulsation(propulsation); 74 mapstorage->set_iteration(iteration); 75 76 mapstorage->redesign_data_changed(); 63 77 } 64 78 -
gui_writer.cc
r174 r177 52 52 } 53 53 x("active_edgemaps", em); 54 55 double attraction; 56 double propulsation; 57 int iteration; 58 59 mapstorage->get_design_data(attraction, propulsation, iteration); 60 61 x("redesign-attraction", attraction); 62 x("redesign-propulsation", propulsation); 63 x("redesign-iteration", iteration); 54 64 } 55 65 -
mapstorage.cc
r174 r177 24 24 #include <gtkmm.h> 25 25 26 MapStorage::MapStorage() : modified(false), file_name(""), arrow_pos_read_ok(false) 26 const double i_d=20; 27 const double a_d=0.05; 28 const double p_d=40000; 29 30 MapStorage::MapStorage() : modified(false), file_name(""), arrow_pos_read_ok(false), iterations(i_d), attraction(a_d), propulsation(p_d) 27 31 { 28 32 nodemap_storage["coordinates_x"] = new Graph::NodeMap<double>(graph); … … 149 153 } 150 154 151 MapStorage::Signal_PropMapStorage::signal_prop_ch()155 sigc::signal<void, bool, int> MapStorage::signal_prop_ch() 152 156 { 153 157 return signal_prop; … … 486 490 signal_map_win.emit(true, i, ""); 487 491 } 492 493 attraction=a_d; 494 propulsation=p_d; 495 iterations=i_d; 496 497 signal_design_win.emit(attraction, propulsation, iterations); 488 498 } 489 499 … … 516 526 } 517 527 } 528 529 void MapStorage::get_design_data(double & attraction_p, double & propulsation_p, int & iterations_p) 530 { 531 attraction_p=attraction; 532 propulsation_p=propulsation; 533 iterations_p=iterations; 534 } 535 536 void MapStorage::set_attraction(double attraction_p) 537 { 538 attraction=attraction_p; 539 } 540 541 void MapStorage::set_propulsation(double propulsation_p) 542 { 543 propulsation=propulsation_p; 544 } 545 546 void MapStorage::set_iteration(int iterations_p) 547 { 548 iterations=iterations_p; 549 } 550 551 void MapStorage::redesign_data_changed() 552 { 553 signal_design_win.emit(attraction, propulsation, iterations); 554 } -
mapstorage.h
r174 r177 83 83 84 84 protected: 85 /// type of the signal emitted if the visualization of the maps might have to be updated. 86 85 86 /// Signal emitted on any change made on map values 87 88 /// Signal emitted if the visualization of the maps might have to be updated. 87 89 /// bool shows us whether the changed map is edge or nodemap. 88 90 /// int tells us the refreshed property 89 typedef sigc::signal<void, bool, int> Signal_Prop; 90 91 /// Signal emitted on any change made on map values 92 Signal_Prop signal_prop; 91 sigc::signal<void, bool, int> signal_prop; 93 92 94 93 /// Signal emitted in the case of nodemap addition … … 106 105 /// Signal emitted, when entry in \ref MapWin should be changed. 107 106 sigc::signal<void, bool, int, std::string> signal_map_win; 107 108 /// Signal emitted, when entry in \ref DesignWin should be changed. 109 sigc::signal<void, double, double, int> signal_design_win; 110 111 ///Iteration number during graph design 112 int iterations; 113 114 ///Attraction factor during graph design 115 double attraction; 116 117 ///Propulsation factor during graph design 118 double propulsation; 108 119 109 120 public: … … 153 164 154 165 ///returns \ref signal_prop to be able to connect functions to it 155 Signal_Propsignal_prop_ch();166 sigc::signal<void, bool, int> signal_prop_ch(); 156 167 157 168 ///returns \ref signal_node_map to be able to connect functions to it … … 163 174 ///returns \ref signal_map_win to be able to connect functions to it 164 175 sigc::signal<void, bool, int, std::string> signal_map_win_ch(){return signal_map_win;}; 176 177 ///returns \ref signal_design_win to be able to connect functions to it 178 sigc::signal<void, double, double, int> signal_design_win_ch(){return signal_design_win;}; 165 179 166 180 ///Adds given map to storage. … … 262 276 263 277 void ArrowPosReadOK(); 278 279 void get_design_data(double &, double &, int &); 280 void set_attraction(double); 281 void set_propulsation(double); 282 void set_iteration(int); 283 284 void redesign_data_changed(); 264 285 }; 265 286 -
nbtab.cc
r174 r177 236 236 double attraction, propulsation; 237 237 int iterations; 238 gd_canvas->get_design_data(attraction, propulsation, iterations);238 mapstorage.get_design_data(attraction, propulsation, iterations); 239 239 designwin=new DesignWin("Design Setup - "+name, attraction, propulsation, iterations, *this); 240 240 241 designwin->signal_attraction().connect(sigc::mem_fun( *this, &NoteBookTab::attraction_ch));242 designwin->signal_propulsation().connect(sigc::mem_fun( *this, &NoteBookTab::propulsation_ch));243 designwin->signal_iteration().connect(sigc::mem_fun( *gd_canvas, &GraphDisplayerCanvas::set_iteration));241 designwin->signal_attraction().connect(sigc::mem_fun(mapstorage, &MapStorage::set_attraction)); 242 designwin->signal_propulsation().connect(sigc::mem_fun(mapstorage, &MapStorage::set_propulsation)); 243 designwin->signal_iteration().connect(sigc::mem_fun(mapstorage, &MapStorage::set_iteration)); 244 244 designwin->close_run().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::reDesignGraph)); 245 245 246 246 designwin->signal_delete_event().connect(sigc::mem_fun(*this, &NoteBookTab::closeDesignWin)); 247 248 mapst2designwin=mapstorage.signal_design_win_ch().connect(sigc::mem_fun(*designwin, &DesignWin::set_data)); 247 249 248 250 designwin->show(); … … 263 265 { 264 266 designwinexists=false; 267 mapst2designwin.disconnect(); 265 268 delete designwin; 266 269 } … … 287 290 } 288 291 289 void NoteBookTab::attraction_ch(double v)290 {291 gd_canvas->set_attraction(v);292 }293 294 void NoteBookTab::propulsation_ch(double v)295 {296 gd_canvas->set_propulsation(v);297 }298 299 void NoteBookTab::iteration_ch(int v)300 {301 gd_canvas->set_iteration(v);302 }303 304 292 void NoteBookTab::active_maps_needed() 305 293 { -
nbtab.h
r174 r177 203 203 void reDesignGraph(); 204 204 205 ///Indicates that attraction factor is changed206 void attraction_ch(double);207 208 ///Indicates that propulsation factor is changed209 void propulsation_ch(double);210 211 ///Indicates that iteration number of redesign is changed212 void iteration_ch(int);213 214 205 ///\ref MapWin calls this function when it updates the maplist in comboboxes. 215 206 void active_maps_needed(); … … 221 212 ///therefore we have to store it. 222 213 sigc::connection mapst2mapwin; 214 215 ///Signal connection from \ref MapStorage to \ref DesignWin 216 217 ///If \ref DesignWin is closed this connection has to be disconnected, 218 ///therefore we have to store it. 219 sigc::connection mapst2designwin; 223 220 }; 224 221
Note: See TracChangeset
for help on using the changeset viewer.