diff -r 48580778851e -r 4e8704aae278 mapstorage.cc --- a/mapstorage.cc Thu Dec 28 15:31:39 2006 +0000 +++ b/mapstorage.cc Wed Jan 10 14:37:46 2007 +0000 @@ -17,6 +17,7 @@ */ #include "mapstorage.h" +#include "nbtab.h" #include "gui_writer.h" #include "gui_reader.h" #include @@ -27,7 +28,7 @@ const double a_d=0.05; const double p_d=40000; -MapStorage::MapStorage() : modified(false), file_name(""), arrow_pos_read_ok(false), iterations(i_d), attraction(a_d), propulsation(p_d) +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) { nodemap_storage["coordinates_x"] = new Graph::NodeMap(graph); coords.setXMap(*nodemap_storage["coordinates_x"]); @@ -552,3 +553,39 @@ { signal_design_win.emit(attraction, propulsation, iterations); } + +void MapStorage::setBackground(const std::string& file_name) +{ + if (file_name == background_file_name) return; + if (file_name == "") + { + background_file_name = ""; + background_set = false; + } + else + { + background_file_name = file_name; + background_set = true; + } + mytab.gd_canvas->setBackground(); +} + +const std::string& MapStorage::getBackgroundFilename() +{ + return background_file_name; +} + +bool MapStorage::isBackgroundSet() +{ + return background_set; +} + +double MapStorage::getBackgroundScaling() +{ + return background_scaling; +} + +void MapStorage::setBackgroundScaling(double scaling) +{ + background_scaling = scaling; +}