COIN-OR::LEMON - Graph Library

Changeset 195:125c56c1efda in glemon-0.x


Ignore:
Timestamp:
03/01/07 09:07:39 (12 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@3206
Message:

Mapstorage does not need to know NoteBookTab? furthermore.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • mapstorage.cc

    r194 r195  
    2222
    2323#include <mapstorage.h>
    24 #include <graph_displayer_canvas.h> //kivenni
    25 #include <nbtab.h> //kivenni
    2624#include <gui_writer.h>
    2725#include <gui_reader.h>
     
    3230const double p_d=40000;
    3331
    34 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)
     32MapStorage::MapStorage() : modified(false), file_name(""), arrow_pos_read_ok(false), iterations(i_d), attraction(a_d), propulsation(p_d), background_set(false)
    3533{
    3634  nodemap_storage["coordinates_x"] = new Graph::NodeMap<double>(graph);
     
    571569    background_set = true;
    572570  }
    573   mytab.gd_canvas->setBackground();
     571  signal_background.emit();
    574572}
    575573
  • mapstorage.h

    r194 r195  
    2323#include <xymap.h>
    2424#include <libgnomecanvasmm.h>
    25 
    26 class NoteBookTab;
    2725
    2826///class MapStorage handles NodeMaps and EdgeMaps.
     
    4341  bool background_set;
    4442  double background_scaling;
    45   NoteBookTab& mytab;
    4643public:
    4744  void setBackground(const std::string& file_name);
     
    116113  sigc::signal<void, double, double, int> signal_design_win;
    117114
     115  ///Signal emitted when background should be set by \ref NoteBookTab
     116  sigc::signal<void> signal_background;
     117
    118118  ///Iteration number during graph design
    119119  int iterations;
     
    130130  ///Its all activity is initializing default values
    131131  ///for different visualization attributes.
    132   MapStorage(NoteBookTab& tab);
     132  MapStorage();
    133133
    134134  ///Destructor of MapStorage
     
    185185  sigc::signal<void, double, double, int> signal_design_win_ch(){return signal_design_win;};
    186186
     187  ///returns \ref signal_background to be able to connect functions to it
     188  sigc::signal<void> signal_background_ch(){return signal_background;};
     189
     190
    187191  ///Adds given map to storage.
    188192
  • nbtab.cc

    r194 r195  
    2828NoteBookTab::NoteBookTab():mapwinexists(false), designwinexists(false)
    2929{
    30   mapstorage=new MapStorage(*this);
     30  mapstorage=new MapStorage();
    3131
    3232  Gtk::ScrolledWindow *pScrolledWindow = manage(new Gtk::ScrolledWindow);
     
    3939  mapstorage->signal_node_map_ch().connect(sigc::mem_fun(*this, &NoteBookTab::registerNewNodeMap));
    4040  mapstorage->signal_edge_map_ch().connect(sigc::mem_fun(*this, &NoteBookTab::registerNewEdgeMap));
     41  mapstorage->signal_background_ch().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::setBackground));
    4142  show_all_children();
    4243  show();
Note: See TracChangeset for help on using the changeset viewer.