equal
deleted
inserted
replaced
21 #include "gui_reader.h" |
21 #include "gui_reader.h" |
22 #include <limits> |
22 #include <limits> |
23 #include <cmath> |
23 #include <cmath> |
24 #include <gtkmm.h> |
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 nodemap_storage["coordinates_x"] = new Graph::NodeMap<double>(graph); |
32 nodemap_storage["coordinates_x"] = new Graph::NodeMap<double>(graph); |
29 coords.setXMap(*nodemap_storage["coordinates_x"]); |
33 coords.setXMap(*nodemap_storage["coordinates_x"]); |
30 nodemap_storage["coordinates_y"] = new Graph::NodeMap<double>(graph); |
34 nodemap_storage["coordinates_y"] = new Graph::NodeMap<double>(graph); |
31 coords.setYMap(*nodemap_storage["coordinates_y"]); |
35 coords.setYMap(*nodemap_storage["coordinates_y"]); |
146 i++; |
150 i++; |
147 } |
151 } |
148 return nml; |
152 return nml; |
149 } |
153 } |
150 |
154 |
151 MapStorage::Signal_Prop MapStorage::signal_prop_ch() |
155 sigc::signal<void, bool, int> MapStorage::signal_prop_ch() |
152 { |
156 { |
153 return signal_prop; |
157 return signal_prop; |
154 } |
158 } |
155 |
159 |
156 int MapStorage::addEdgeMap(const std::string & name, Graph::EdgeMap<double> *edgemap, double default_value) |
160 int MapStorage::addEdgeMap(const std::string & name, Graph::EdgeMap<double> *edgemap, double default_value) |
483 for(int i=0;i<EDGE_PROPERTY_NUM;i++) |
487 for(int i=0;i<EDGE_PROPERTY_NUM;i++) |
484 { |
488 { |
485 changeActiveMap(true, i, ""); |
489 changeActiveMap(true, i, ""); |
486 signal_map_win.emit(true, i, ""); |
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 |
490 void MapStorage::ArrowPosReadOK() |
500 void MapStorage::ArrowPosReadOK() |
491 { |
501 { |
492 arrow_pos_read_ok = true; |
502 arrow_pos_read_ok = true; |
513 signal_prop.emit(itisedge, i); |
523 signal_prop.emit(itisedge, i); |
514 } |
524 } |
515 } |
525 } |
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 } |