COIN-OR::LEMON - Graph Library

Changeset 184:4e8704aae278 in glemon-0.x for mapstorage.cc


Ignore:
Timestamp:
01/10/07 15:37:46 (17 years ago)
Author:
Akos Ladanyi
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@3125
Message:

Added support for setting the background form an image file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mapstorage.cc

    r177 r184  
    1818
    1919#include "mapstorage.h"
     20#include "nbtab.h"
    2021#include "gui_writer.h"
    2122#include "gui_reader.h"
     
    2829const double p_d=40000;
    2930
    30 MapStorage::MapStorage() : modified(false), file_name(""), arrow_pos_read_ok(false), iterations(i_d), attraction(a_d), propulsation(p_d)
     31MapStorage::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)
    3132{
    3233  nodemap_storage["coordinates_x"] = new Graph::NodeMap<double>(graph);
     
    553554  signal_design_win.emit(attraction, propulsation, iterations);
    554555}
     556
     557void MapStorage::setBackground(const std::string& file_name)
     558{
     559  if (file_name == background_file_name) return;
     560  if (file_name == "")
     561  {
     562    background_file_name = "";
     563    background_set = false;
     564  }
     565  else
     566  {
     567    background_file_name = file_name;
     568    background_set = true;
     569  }
     570  mytab.gd_canvas->setBackground();
     571}
     572
     573const std::string& MapStorage::getBackgroundFilename()
     574{
     575  return background_file_name;
     576}
     577
     578bool MapStorage::isBackgroundSet()
     579{
     580  return background_set;
     581}
     582
     583double MapStorage::getBackgroundScaling()
     584{
     585  return background_scaling;
     586}
     587
     588void MapStorage::setBackgroundScaling(double scaling)
     589{
     590  background_scaling = scaling;
     591}
Note: See TracChangeset for help on using the changeset viewer.