1.1 --- a/mapstorage.cc Thu Dec 28 15:31:39 2006 +0000
1.2 +++ b/mapstorage.cc Wed Jan 10 14:37:46 2007 +0000
1.3 @@ -17,6 +17,7 @@
1.4 */
1.5
1.6 #include "mapstorage.h"
1.7 +#include "nbtab.h"
1.8 #include "gui_writer.h"
1.9 #include "gui_reader.h"
1.10 #include <limits>
1.11 @@ -27,7 +28,7 @@
1.12 const double a_d=0.05;
1.13 const double p_d=40000;
1.14
1.15 -MapStorage::MapStorage() : modified(false), file_name(""), arrow_pos_read_ok(false), iterations(i_d), attraction(a_d), propulsation(p_d)
1.16 +MapStorage::MapStorage(NoteBookTab& tab) : mytab(tab), modified(false), file_name(""), arrow_pos_read_ok(false), iterations(i_d), attraction(a_d), propulsation(p_d), background_set(false)
1.17 {
1.18 nodemap_storage["coordinates_x"] = new Graph::NodeMap<double>(graph);
1.19 coords.setXMap(*nodemap_storage["coordinates_x"]);
1.20 @@ -552,3 +553,39 @@
1.21 {
1.22 signal_design_win.emit(attraction, propulsation, iterations);
1.23 }
1.24 +
1.25 +void MapStorage::setBackground(const std::string& file_name)
1.26 +{
1.27 + if (file_name == background_file_name) return;
1.28 + if (file_name == "")
1.29 + {
1.30 + background_file_name = "";
1.31 + background_set = false;
1.32 + }
1.33 + else
1.34 + {
1.35 + background_file_name = file_name;
1.36 + background_set = true;
1.37 + }
1.38 + mytab.gd_canvas->setBackground();
1.39 +}
1.40 +
1.41 +const std::string& MapStorage::getBackgroundFilename()
1.42 +{
1.43 + return background_file_name;
1.44 +}
1.45 +
1.46 +bool MapStorage::isBackgroundSet()
1.47 +{
1.48 + return background_set;
1.49 +}
1.50 +
1.51 +double MapStorage::getBackgroundScaling()
1.52 +{
1.53 + return background_scaling;
1.54 +}
1.55 +
1.56 +void MapStorage::setBackgroundScaling(double scaling)
1.57 +{
1.58 + background_scaling = scaling;
1.59 +}