Header reorganising
authorhegyi
Wed, 28 Feb 2007 18:20:28 +0000
changeset 1946b2b718420eb
parent 193 2a9a5d7f1a16
child 195 125c56c1efda
Header reorganising
algobox.cc
algobox.h
algowin.cc
algowin.h
background_chooser_dialog.cc
design_win.cc
design_win.h
dijkstrabox.cc
dijkstrabox.h
eps_win.cc
eps_win.h
gdc-broken_edge.cc
graph-displayer.cc
graph_displayer_canvas-edge.cc
graph_displayer_canvas-event.cc
graph_displayer_canvas-node.cc
graph_displayer_canvas-zoom.cc
graph_displayer_canvas.cc
graph_displayer_canvas.h
gui_reader.cc
gui_reader.h
gui_writer.cc
gui_writer.h
kruskalbox.cc
kruskalbox.h
main_win.cc
main_win.h
map_win.cc
map_win.h
mapselector.cc
mapselector.h
mapstorage.cc
mapstorage.h
nbtab.cc
nbtab.h
new_map_win.cc
new_map_win.h
     1.1 --- a/algobox.cc	Wed Feb 28 15:19:20 2007 +0000
     1.2 +++ b/algobox.cc	Wed Feb 28 18:20:28 2007 +0000
     1.3 @@ -17,6 +17,8 @@
     1.4   */
     1.5  
     1.6  #include <algobox.h>
     1.7 +#include <mapstorage.h>
     1.8 +#include <mapselector.h>
     1.9  
    1.10  enum {N_DEMO1, N_DEMO2, NODE_INPUT_NUM}; // input IDs for nodes;
    1.11  enum {E_DEMO1, EDGE_INPUT_NUM}; // input IDs for edges;
     2.1 --- a/algobox.h	Wed Feb 28 15:19:20 2007 +0000
     2.2 +++ b/algobox.h	Wed Feb 28 18:20:28 2007 +0000
     2.3 @@ -19,11 +19,10 @@
     2.4  #ifndef ALGOBOX_H
     2.5  #define ALGOBOX_H
     2.6  
     2.7 -class AlgoBox;
     2.8 +class MapStorage;
     2.9 +class MapSelector;
    2.10  
    2.11  #include <all_include.h>
    2.12 -#include <mapstorage.h>
    2.13 -#include <mapselector.h>
    2.14  #include <libgnomecanvasmm.h>
    2.15  #include <libgnomecanvasmm/polygon.h>
    2.16  
     3.1 --- a/algowin.cc	Wed Feb 28 15:19:20 2007 +0000
     3.2 +++ b/algowin.cc	Wed Feb 28 18:20:28 2007 +0000
     3.3 @@ -17,6 +17,7 @@
     3.4   */
     3.5  
     3.6  #include <algowin.h>
     3.7 +#include <algobox.h>
     3.8  #include <kruskalbox.h>
     3.9  #include <dijkstrabox.h>
    3.10  
     4.1 --- a/algowin.h	Wed Feb 28 15:19:20 2007 +0000
     4.2 +++ b/algowin.h	Wed Feb 28 18:20:28 2007 +0000
     4.3 @@ -19,14 +19,11 @@
     4.4  #ifndef ALGOWIN_H
     4.5  #define ALGOWIN_H
     4.6  
     4.7 -class AlgoWin;
     4.8 -
     4.9  #include <all_include.h>
    4.10 -//#include <mapstorage.h>
    4.11 -#include <algobox.h>
    4.12  #include <libgnomecanvasmm.h>
    4.13  #include <libgnomecanvasmm/polygon.h>
    4.14  
    4.15 +class AlgoBox;
    4.16  class MapStorage;
    4.17  
    4.18  ///Algorithm identifiers.
     5.1 --- a/background_chooser_dialog.cc	Wed Feb 28 15:19:20 2007 +0000
     5.2 +++ b/background_chooser_dialog.cc	Wed Feb 28 18:20:28 2007 +0000
     5.3 @@ -1,6 +1,6 @@
     5.4 -#include "background_chooser_dialog.h"
     5.5 +#include <background_chooser_dialog.h>
     5.6  #include <gtkmm/stock.h>
     5.7 -#include "mapstorage.h"
     5.8 +#include <mapstorage.h>
     5.9  
    5.10  BackgroundChooserDialog::BackgroundChooserDialog(MapStorage* ms) :
    5.11    mapstorage(ms),
     6.1 --- a/design_win.cc	Wed Feb 28 15:19:20 2007 +0000
     6.2 +++ b/design_win.cc	Wed Feb 28 18:20:28 2007 +0000
     6.3 @@ -16,6 +16,7 @@
     6.4   *
     6.5   */
     6.6  
     6.7 +#include <nbtab.h>
     6.8  #include <design_win.h>
     6.9  
    6.10  bool DesignWin::closeIfEscapeIsPressed(GdkEventKey* e)
     7.1 --- a/design_win.h	Wed Feb 28 15:19:20 2007 +0000
     7.2 +++ b/design_win.h	Wed Feb 28 18:20:28 2007 +0000
     7.3 @@ -19,10 +19,9 @@
     7.4  #ifndef DESWIN_H
     7.5  #define DESWIN_H
     7.6  
     7.7 -class DesignWin;
     7.8 +class NoteBookTab;
     7.9  
    7.10  #include <all_include.h>
    7.11 -#include <nbtab.h>
    7.12  #include <libgnomecanvasmm.h>
    7.13  #include <libgnomecanvasmm/polygon.h>
    7.14  
     8.1 --- a/dijkstrabox.cc	Wed Feb 28 15:19:20 2007 +0000
     8.2 +++ b/dijkstrabox.cc	Wed Feb 28 18:20:28 2007 +0000
     8.3 @@ -16,7 +16,11 @@
     8.4   *
     8.5   */
     8.6  
     8.7 +#include <mapstorage.h>
     8.8 +#include <mapselector.h>
     8.9 +#include <algobox.h>
    8.10  #include <dijkstrabox.h>
    8.11 +
    8.12  #include <lemon/dijkstra.h>
    8.13  #include <lemon/suurballe.h>
    8.14  #include <lemon/path.h>
     9.1 --- a/dijkstrabox.h	Wed Feb 28 15:19:20 2007 +0000
     9.2 +++ b/dijkstrabox.h	Wed Feb 28 18:20:28 2007 +0000
     9.3 @@ -19,10 +19,9 @@
     9.4  #ifndef DIJKSTRABOX_H
     9.5  #define DIJKSTRABOX_H
     9.6  
     9.7 -class DijkstraBox;
     9.8 +class AlgoBox;
     9.9  
    9.10  #include <all_include.h>
    9.11 -#include <algobox.h>
    9.12  #include <libgnomecanvasmm.h>
    9.13  #include <libgnomecanvasmm/polygon.h>
    9.14  
    10.1 --- a/eps_win.cc	Wed Feb 28 15:19:20 2007 +0000
    10.2 +++ b/eps_win.cc	Wed Feb 28 18:20:28 2007 +0000
    10.3 @@ -16,7 +16,8 @@
    10.4   *
    10.5   */
    10.6  
    10.7 -#include "eps_win.h"
    10.8 +#include <nbtab.h>
    10.9 +#include <eps_win.h>
   10.10  #include <set>
   10.11  
   10.12  bool EpsWin::closeIfEscapeIsPressed(GdkEventKey* e)
    11.1 --- a/eps_win.h	Wed Feb 28 15:19:20 2007 +0000
    11.2 +++ b/eps_win.h	Wed Feb 28 18:20:28 2007 +0000
    11.3 @@ -19,11 +19,9 @@
    11.4  #ifndef EPS_WIN_H
    11.5  #define EPS_WIN_H
    11.6  
    11.7 -class EpsWin;
    11.8 +class NoteBookTab;
    11.9  
   11.10  #include <all_include.h>
   11.11 -#include <nbtab.h>
   11.12 -#include <mapselector.h>
   11.13  #include <libgnomecanvasmm.h>
   11.14  #include <libgnomecanvasmm/polygon.h>
   11.15  
    12.1 --- a/gdc-broken_edge.cc	Wed Feb 28 15:19:20 2007 +0000
    12.2 +++ b/gdc-broken_edge.cc	Wed Feb 28 18:20:28 2007 +0000
    12.3 @@ -16,7 +16,9 @@
    12.4   *
    12.5   */
    12.6  
    12.7 -#include "graph_displayer_canvas.h"
    12.8 +#include <graph_displayer_canvas.h>
    12.9 +#include <mapstorage.h>
   12.10 +#include <nbtab.h>
   12.11  #include <cmath>
   12.12  
   12.13  GraphDisplayerCanvas::EdgeBase::EdgeBase(Gnome::Canvas::Group& _group, Edge _edge, GraphDisplayerCanvas& _canvas) : 
   12.14 @@ -33,7 +35,7 @@
   12.15  
   12.16  void GraphDisplayerCanvas::EdgeBase::drawArrow(XY unit_vector_in_dir)
   12.17  {
   12.18 -  MapStorage& ms = canvas.mytab.mapstorage;
   12.19 +  MapStorage& ms = *canvas.mytab.mapstorage;
   12.20    XY center(ms.arrow_pos[edge]);
   12.21    XY unit_norm_vector(0-unit_vector_in_dir.y, unit_vector_in_dir.x);
   12.22  
   12.23 @@ -84,7 +86,7 @@
   12.24  
   12.25  void GraphDisplayerCanvas::BrokenEdge::draw()
   12.26  {
   12.27 -  MapStorage& ms = canvas.mytab.mapstorage;
   12.28 +  MapStorage& ms = *canvas.mytab.mapstorage;
   12.29  
   12.30    //calculating coordinates of the direction indicator arrow
   12.31    XY head(ms.coords[ms.graph.target(edge)]);
   12.32 @@ -150,10 +152,10 @@
   12.33  
   12.34          Gnome::Canvas::Points points_new;
   12.35  
   12.36 -        canvas.mytab.mapstorage.arrow_pos.set(edge, canvas.mytab.mapstorage.arrow_pos[edge] + XY(dx, dy));
   12.37 +        canvas.mytab.mapstorage->arrow_pos.set(edge, canvas.mytab.mapstorage->arrow_pos[edge] + XY(dx, dy));
   12.38  
   12.39          draw();
   12.40 -        canvas.textReposition(canvas.mytab.mapstorage.arrow_pos[edge]);
   12.41 +        canvas.textReposition(canvas.mytab.mapstorage->arrow_pos[edge]);
   12.42  
   12.43          clicked_x=e->motion.x;
   12.44          clicked_y=e->motion.y;
   12.45 @@ -194,7 +196,7 @@
   12.46  
   12.47  void GraphDisplayerCanvas::LoopEdge::draw()
   12.48  {
   12.49 -  MapStorage& ms = canvas.mytab.mapstorage;
   12.50 +  MapStorage& ms = *canvas.mytab.mapstorage;
   12.51  
   12.52    Node node = ms.graph.source(edge);
   12.53    XY center = (ms.coords[node] + ms.arrow_pos[edge]) / 2.0;
   12.54 @@ -247,10 +249,10 @@
   12.55      case GDK_MOTION_NOTIFY:
   12.56        if(isbutton)
   12.57        {
   12.58 -        canvas.mytab.mapstorage.arrow_pos.set(edge, XY(e->motion.x, e->motion.y));
   12.59 +        canvas.mytab.mapstorage->arrow_pos.set(edge, XY(e->motion.x, e->motion.y));
   12.60  
   12.61          draw();
   12.62 -        canvas.textReposition(canvas.mytab.mapstorage.arrow_pos[edge]);
   12.63 +        canvas.textReposition(canvas.mytab.mapstorage->arrow_pos[edge]);
   12.64        }
   12.65      default: break;
   12.66    }
    13.1 --- a/graph-displayer.cc	Wed Feb 28 15:19:20 2007 +0000
    13.2 +++ b/graph-displayer.cc	Wed Feb 28 18:20:28 2007 +0000
    13.3 @@ -21,7 +21,6 @@
    13.4  #endif
    13.5  
    13.6  #include "all_include.h"
    13.7 -#include "mapstorage.h"
    13.8  #include "main_win.h"
    13.9  #include <libgnomecanvasmm.h>
   13.10  #include <libgnomecanvasmm/polygon.h>
    14.1 --- a/graph_displayer_canvas-edge.cc	Wed Feb 28 15:19:20 2007 +0000
    14.2 +++ b/graph_displayer_canvas-edge.cc	Wed Feb 28 18:20:28 2007 +0000
    14.3 @@ -16,7 +16,9 @@
    14.4   *
    14.5   */
    14.6  
    14.7 -#include "graph_displayer_canvas.h"
    14.8 +#include <graph_displayer_canvas.h>
    14.9 +#include <mapstorage.h>
   14.10 +#include <nbtab.h>
   14.11  #include <cmath>
   14.12  
   14.13  const int minimum_edge_width=0;
   14.14 @@ -27,11 +29,11 @@
   14.15  
   14.16    min=edge_property_defaults[E_WIDTH];
   14.17    max=edge_property_defaults[E_WIDTH];
   14.18 -  Graph::EdgeMap<double> actual_map((mytab.mapstorage).graph,edge_property_defaults[E_WIDTH]);
   14.19 +  Graph::EdgeMap<double> actual_map((mytab.mapstorage)->graph,edge_property_defaults[E_WIDTH]);
   14.20    
   14.21    if(edge==INVALID)
   14.22      {
   14.23 -      for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   14.24 +      for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
   14.25  	{
   14.26  	  double v=fabs(actual_map[i]);
   14.27  	  int w;
   14.28 @@ -68,13 +70,13 @@
   14.29    Graph::EdgeMap<double> * actual_map;
   14.30    double min, max;
   14.31  
   14.32 -  min=(mytab.mapstorage).minOfEdgeMap(mapname);
   14.33 -  max=(mytab.mapstorage).maxOfEdgeMap(mapname);
   14.34 -  actual_map=((mytab.mapstorage).edgemap_storage)[mapname];
   14.35 +  min=(mytab.mapstorage)->minOfEdgeMap(mapname);
   14.36 +  max=(mytab.mapstorage)->maxOfEdgeMap(mapname);
   14.37 +  actual_map=((mytab.mapstorage)->edgemap_storage)[mapname];
   14.38  
   14.39    if(edge==INVALID)
   14.40      {
   14.41 -      for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   14.42 +      for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
   14.43  	{
   14.44  	  double v=(*actual_map)[i];
   14.45  	  int w;
   14.46 @@ -131,16 +133,16 @@
   14.47    //the minimum of the nodemap to the range of
   14.48    //green in RGB
   14.49    Graph::EdgeMap<double> * actual_map;
   14.50 -  actual_map=((mytab.mapstorage).edgemap_storage)[mapname];
   14.51 +  actual_map=((mytab.mapstorage)->edgemap_storage)[mapname];
   14.52  
   14.53    double max, min;
   14.54  
   14.55 -  max=(mytab.mapstorage).maxOfEdgeMap(mapname);
   14.56 -  min=(mytab.mapstorage).minOfEdgeMap(mapname);
   14.57 +  max=(mytab.mapstorage)->maxOfEdgeMap(mapname);
   14.58 +  min=(mytab.mapstorage)->minOfEdgeMap(mapname);
   14.59  
   14.60    if(edge==INVALID)
   14.61      {
   14.62 -      for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   14.63 +      for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
   14.64  	{
   14.65  	  double w=(*actual_map)[i];
   14.66  
   14.67 @@ -182,7 +184,7 @@
   14.68    //function maps the range of the maximum and
   14.69    //the minimum of the nodemap to the range of
   14.70    //green in RGB
   14.71 -  Graph::EdgeMap<double> actual_map((mytab.mapstorage).graph,edge_property_defaults[E_COLOR]);
   14.72 +  Graph::EdgeMap<double> actual_map((mytab.mapstorage)->graph,edge_property_defaults[E_COLOR]);
   14.73  
   14.74    double max, min;
   14.75  
   14.76 @@ -191,7 +193,7 @@
   14.77  
   14.78    if(edge==INVALID)
   14.79      {
   14.80 -      for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   14.81 +      for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
   14.82  	{
   14.83  	  double w=actual_map[i];
   14.84  
   14.85 @@ -236,10 +238,10 @@
   14.86    
   14.87    if(edge==INVALID)
   14.88      {
   14.89 -      for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   14.90 +      for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
   14.91  	{
   14.92  	  edgemap_to_edit=mapname;
   14.93 -	  double number=(*((mytab.mapstorage).edgemap_storage)[mapname])[i];
   14.94 +	  double number=(*((mytab.mapstorage)->edgemap_storage)[mapname])[i];
   14.95  	  
   14.96  	  std::ostringstream ostr;
   14.97  	  ostr << number;
   14.98 @@ -250,7 +252,7 @@
   14.99      }
  14.100    else
  14.101      {
  14.102 -	  double number=(*((mytab.mapstorage).edgemap_storage)[mapname])[edge];
  14.103 +	  double number=(*((mytab.mapstorage)->edgemap_storage)[mapname])[edge];
  14.104  
  14.105  	  std::ostringstream ostr;
  14.106  	  ostr << number;
  14.107 @@ -271,7 +273,7 @@
  14.108    
  14.109    if(edge==INVALID)
  14.110      {
  14.111 -      for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
  14.112 +      for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
  14.113  	{
  14.114  	  edgemap_to_edit="";
  14.115  	  edgetextmap[i]->property_text().set_value("");
    15.1 --- a/graph_displayer_canvas-event.cc	Wed Feb 28 15:19:20 2007 +0000
    15.2 +++ b/graph_displayer_canvas-event.cc	Wed Feb 28 18:20:28 2007 +0000
    15.3 @@ -16,7 +16,9 @@
    15.4   *
    15.5   */
    15.6  
    15.7 -#include "graph_displayer_canvas.h"
    15.8 +#include <graph_displayer_canvas.h>
    15.9 +#include <mapstorage.h>
   15.10 +#include <nbtab.h>
   15.11  #include <cmath>
   15.12  
   15.13  
   15.14 @@ -145,7 +147,7 @@
   15.15        
   15.16        active_item=(get_item_at(clicked_x, clicked_y));
   15.17        active_node=INVALID;
   15.18 -      for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   15.19 +      for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
   15.20  	{
   15.21  	  if(nodesmap[i]==active_item)
   15.22  	    {
   15.23 @@ -168,7 +170,7 @@
   15.24        //we only have to do sg. if the mouse button is pressed AND the click was on a node that was found in the set of nodes
   15.25        if(active_node!=INVALID)
   15.26  	{
   15.27 -	  (mytab.mapstorage).modified = true;
   15.28 +	  (mytab.mapstorage)->modified = true;
   15.29  	  
   15.30  	  //new coordinates will be the old values,
   15.31  	  //because the item will be moved to the
   15.32 @@ -190,25 +192,25 @@
   15.33  	  // reposition the coordinates text
   15.34  	  std::ostringstream ostr;
   15.35  	  ostr << "(" <<
   15.36 -	    (mytab.mapstorage).coords[active_node].x << ", " <<
   15.37 -	    (mytab.mapstorage).coords[active_node].y << ")";
   15.38 +	    (mytab.mapstorage)->coords[active_node].x << ", " <<
   15.39 +	    (mytab.mapstorage)->coords[active_node].y << ")";
   15.40  	  double radius =
   15.41  	    (nodesmap[active_node]->property_x2().get_value() -
   15.42  	     nodesmap[active_node]->property_x1().get_value()) / 2.0;
   15.43  	  if (coord_text)
   15.44  	    {
   15.45  	      coord_text->property_text().set_value(ostr.str());
   15.46 -	      coord_text->property_x().set_value((mytab.mapstorage).coords[active_node].x +
   15.47 +	      coord_text->property_x().set_value((mytab.mapstorage)->coords[active_node].x +
   15.48  						 radius);
   15.49 -	      coord_text->property_y().set_value((mytab.mapstorage).coords[active_node].y -
   15.50 +	      coord_text->property_y().set_value((mytab.mapstorage)->coords[active_node].y -
   15.51  						 radius);
   15.52  	    }
   15.53  	  else
   15.54  	    {
   15.55  	      coord_text = new Gnome::Canvas::Text(
   15.56  						   displayed_graph,
   15.57 -						   (mytab.mapstorage).coords[active_node].x + radius,
   15.58 -						   (mytab.mapstorage).coords[active_node].y - radius,
   15.59 +						   (mytab.mapstorage)->coords[active_node].x + radius,
   15.60 +						   (mytab.mapstorage)->coords[active_node].y - radius,
   15.61  						   ostr.str());
   15.62  	      coord_text->property_fill_color().set_value("black");
   15.63  	      coord_text->property_anchor().set_value(Gtk::ANCHOR_SOUTH_WEST);
   15.64 @@ -299,35 +301,35 @@
   15.65        }
   15.66  
   15.67      case GDK_BUTTON_RELEASE:
   15.68 -      (mytab.mapstorage).modified = true;
   15.69 +      (mytab.mapstorage)->modified = true;
   15.70  
   15.71        is_drawn=true;
   15.72  
   15.73        isbutton=1;
   15.74  
   15.75 -      active_node=(mytab.mapstorage).graph.addNode();
   15.76 +      active_node=(mytab.mapstorage)->graph.addNode();
   15.77  
   15.78        //initiating values corresponding to new node in maps
   15.79  
   15.80        window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
   15.81  
   15.82        // update coordinates
   15.83 -      (mytab.mapstorage).coords.set(active_node, XY(clicked_x, clicked_y));
   15.84 +      (mytab.mapstorage)->coords.set(active_node, XY(clicked_x, clicked_y));
   15.85  
   15.86        // update all other maps
   15.87        for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
   15.88 -          (mytab.mapstorage).nodemap_storage.begin(); it !=
   15.89 -          (mytab.mapstorage).nodemap_storage.end(); ++it)
   15.90 +          (mytab.mapstorage)->nodemap_storage.begin(); it !=
   15.91 +          (mytab.mapstorage)->nodemap_storage.end(); ++it)
   15.92        {
   15.93          if ((it->first != "coordinates_x") &&
   15.94              (it->first != "coordinates_y"))
   15.95          {
   15.96            (*(it->second))[active_node] =
   15.97 -            (mytab.mapstorage).nodemap_default[it->first];
   15.98 +            (mytab.mapstorage)->nodemap_default[it->first];
   15.99          }
  15.100        }
  15.101        // increment the id map's default value
  15.102 -      (mytab.mapstorage).nodemap_default["label"] += 1.0;
  15.103 +      (mytab.mapstorage)->nodemap_default["label"] += 1.0;
  15.104  
  15.105        nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph,
  15.106            clicked_x-20, clicked_y-20, clicked_x+20, clicked_y+20);
  15.107 @@ -377,7 +379,7 @@
  15.108  
  15.109            active_item=(get_item_at(clicked_x, clicked_y));
  15.110            active_node=INVALID;
  15.111 -          for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
  15.112 +          for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
  15.113            {
  15.114              if(nodesmap[i]==active_item)
  15.115              {
  15.116 @@ -406,7 +408,7 @@
  15.117            window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
  15.118            target_item=(get_item_at(clicked_x, clicked_y));
  15.119            Node target_node=INVALID;
  15.120 -          for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
  15.121 +          for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
  15.122            {
  15.123              if(nodesmap[i]==target_item)
  15.124              {
  15.125 @@ -416,31 +418,31 @@
  15.126            //the clicked item is a node, the edge can be drawn
  15.127            if(target_node!=INVALID)
  15.128            {
  15.129 -            (mytab.mapstorage).modified = true;
  15.130 +            (mytab.mapstorage)->modified = true;
  15.131  
  15.132              *(nodesmap[target_node]) <<
  15.133                Gnome::Canvas::Properties::fill_color("red");
  15.134  
  15.135              //creating new edge
  15.136 -            active_edge=(mytab.mapstorage).graph.addEdge(active_node,
  15.137 +            active_edge=(mytab.mapstorage)->graph.addEdge(active_node,
  15.138                  target_node);
  15.139  
  15.140              // update maps
  15.141              for (std::map<std::string,
  15.142                  Graph::EdgeMap<double>*>::const_iterator it =
  15.143 -                (mytab.mapstorage).edgemap_storage.begin(); it !=
  15.144 -                (mytab.mapstorage).edgemap_storage.end(); ++it)
  15.145 +                (mytab.mapstorage)->edgemap_storage.begin(); it !=
  15.146 +                (mytab.mapstorage)->edgemap_storage.end(); ++it)
  15.147              {
  15.148                (*(it->second))[active_edge] =
  15.149 -                (mytab.mapstorage).edgemap_default[it->first];
  15.150 +                (mytab.mapstorage)->edgemap_default[it->first];
  15.151              }
  15.152              // increment the id map's default value
  15.153 -            (mytab.mapstorage).edgemap_default["label"] += 1.0;
  15.154 +            (mytab.mapstorage)->edgemap_default["label"] += 1.0;
  15.155  
  15.156              if(target_node!=active_node)		
  15.157              {
  15.158                // set the coordinates of the arrow on the new edge
  15.159 -              MapStorage& ms = mytab.mapstorage;
  15.160 +              MapStorage& ms = *mytab.mapstorage;
  15.161                ms.arrow_pos.set(active_edge,
  15.162                    (ms.coords[ms.graph.source(active_edge)] +
  15.163                     ms.coords[ms.graph.target(active_edge)])/ 2.0);
  15.164 @@ -452,7 +454,7 @@
  15.165              else
  15.166              {
  15.167                // set the coordinates of the arrow on the new edge
  15.168 -              MapStorage& ms = mytab.mapstorage;
  15.169 +              MapStorage& ms = *mytab.mapstorage;
  15.170                ms.arrow_pos.set(active_edge,
  15.171                    (ms.coords[ms.graph.source(active_edge)] +
  15.172                     XY(0.0, 80.0)));
  15.173 @@ -463,7 +465,7 @@
  15.174              }
  15.175  
  15.176              //initializing edge-text as well, to empty string
  15.177 -            XY text_pos=mytab.mapstorage.arrow_pos[active_edge];
  15.178 +            XY text_pos=mytab.mapstorage->arrow_pos[active_edge];
  15.179              text_pos+=(XY(10,10));
  15.180  
  15.181              edgetextmap[active_edge]=new Gnome::Canvas::Text(displayed_graph,
  15.182 @@ -497,7 +499,7 @@
  15.183          }
  15.184          if(target_item)
  15.185          {
  15.186 -	  propertyUpdate((mytab.mapstorage).graph.target(active_edge),N_COLOR);
  15.187 +	  propertyUpdate((mytab.mapstorage)->graph.target(active_edge),N_COLOR);
  15.188            target_item=NULL;
  15.189          }
  15.190          active_node=INVALID;
  15.191 @@ -521,7 +523,7 @@
  15.192        active_node=INVALID;
  15.193        active_edge=INVALID;
  15.194        //was it a node?
  15.195 -      for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
  15.196 +      for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
  15.197  	{
  15.198  	  if(nodesmap[i]==active_item)
  15.199  	    {
  15.200 @@ -531,7 +533,7 @@
  15.201        //or was it an edge?
  15.202        if(active_node==INVALID)
  15.203  	{
  15.204 -	  for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
  15.205 +	  for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
  15.206  	    {
  15.207  	      if(edgesmap[i]->getLine()==active_item)
  15.208  		{
  15.209 @@ -560,16 +562,16 @@
  15.210  	      //a node was found
  15.211  	      if(active_node!=INVALID)
  15.212  		{
  15.213 -                  (mytab.mapstorage).modified = true;
  15.214 +                  (mytab.mapstorage)->modified = true;
  15.215  
  15.216  		  std::set<Graph::Edge> edges_to_delete;
  15.217  
  15.218 -		  for(OutEdgeIt e((mytab.mapstorage).graph,active_node);e!=INVALID;++e)
  15.219 +		  for(OutEdgeIt e((mytab.mapstorage)->graph,active_node);e!=INVALID;++e)
  15.220  		    {
  15.221  		      edges_to_delete.insert(e);
  15.222  		    }
  15.223  		  
  15.224 -		  for(InEdgeIt e((mytab.mapstorage).graph,active_node);e!=INVALID;++e)
  15.225 +		  for(InEdgeIt e((mytab.mapstorage)->graph,active_node);e!=INVALID;++e)
  15.226  		    {
  15.227  		      edges_to_delete.insert(e);
  15.228  		    }
  15.229 @@ -635,7 +637,7 @@
  15.230  	    active_item=(get_item_at(clicked_x, clicked_y));
  15.231  
  15.232  	    //find the activated item between text of nodes
  15.233 -	    for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
  15.234 +	    for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
  15.235  	      {
  15.236  		//at the same time only one can be active
  15.237  		if(nodetextmap[i]==active_item)
  15.238 @@ -647,7 +649,7 @@
  15.239  	    //if there was not, search for it between nodes
  15.240  	    if(clicked_node==INVALID)
  15.241  	      {
  15.242 -		for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
  15.243 +		for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
  15.244  		  {
  15.245  		    //at the same time only one can be active
  15.246  		    if(nodesmap[i]==active_item)
  15.247 @@ -660,7 +662,7 @@
  15.248  	    if(clicked_node==INVALID)
  15.249  	      {
  15.250  		//find the activated item between texts
  15.251 -		for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
  15.252 +		for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
  15.253  		  {
  15.254  		    //at the same time only one can be active
  15.255  		    if(edgetextmap[i]==active_item)
  15.256 @@ -672,7 +674,7 @@
  15.257  		//if it was not between texts, search for it between edges
  15.258  		if(clicked_edge==INVALID)
  15.259  		  {
  15.260 -		    for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
  15.261 +		    for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
  15.262  		      {
  15.263  			//at the same time only one can be active
  15.264  			if((edgesmap[i]->getLine())==active_item)
  15.265 @@ -714,7 +716,7 @@
  15.266  			break;
  15.267  		      case Gtk::RESPONSE_ACCEPT:
  15.268  			double new_value = spin.get_value();
  15.269 -			(*(mytab.mapstorage).nodemap_storage[nodemap_to_edit])[active_node] =
  15.270 +			(*(mytab.mapstorage)->nodemap_storage[nodemap_to_edit])[active_node] =
  15.271  			  new_value;
  15.272  			std::ostringstream ostr;
  15.273  			ostr << new_value;
  15.274 @@ -757,7 +759,7 @@
  15.275  			  break;
  15.276  			case Gtk::RESPONSE_ACCEPT:
  15.277  			  double new_value = spin.get_value();
  15.278 -			  (*(mytab.mapstorage).edgemap_storage[edgemap_to_edit])[active_edge] =
  15.279 +			  (*(mytab.mapstorage)->edgemap_storage[edgemap_to_edit])[active_edge] =
  15.280  			    new_value;
  15.281  			  std::ostringstream ostr;
  15.282  			  ostr << new_value;
  15.283 @@ -782,14 +784,14 @@
  15.284  {
  15.285    delete(nodetextmap[node_to_delete]);
  15.286    delete(nodesmap[node_to_delete]);
  15.287 -  (mytab.mapstorage).graph.erase(node_to_delete);
  15.288 +  (mytab.mapstorage)->graph.erase(node_to_delete);
  15.289  }
  15.290  
  15.291  void GraphDisplayerCanvas::deleteItem(Edge edge_to_delete)
  15.292  {
  15.293    delete(edgetextmap[edge_to_delete]);
  15.294    delete(edgesmap[edge_to_delete]);
  15.295 -  (mytab.mapstorage).graph.erase(edge_to_delete);
  15.296 +  (mytab.mapstorage)->graph.erase(edge_to_delete);
  15.297  }
  15.298  
  15.299  void GraphDisplayerCanvas::textReposition(XY new_place)
  15.300 @@ -809,7 +811,7 @@
  15.301      }
  15.302      else
  15.303      {
  15.304 -      for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
  15.305 +      for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
  15.306        {
  15.307          if(edgesmap[i]==active_bre)
  15.308          {
  15.309 @@ -851,62 +853,62 @@
  15.310    nodetextmap[moved_node]->move(dx, dy);
  15.311  
  15.312    // the new coordinates of the centre of the node 
  15.313 -  double coord_x = dx + (mytab.mapstorage).coords[moved_node].x;
  15.314 -  double coord_y = dy + (mytab.mapstorage).coords[moved_node].y;
  15.315 +  double coord_x = dx + (mytab.mapstorage)->coords[moved_node].x;
  15.316 +  double coord_y = dy + (mytab.mapstorage)->coords[moved_node].y;
  15.317  
  15.318    // write back the new coordinates to the coords map
  15.319 -  (mytab.mapstorage).coords.set(moved_node, XY(coord_x, coord_y));
  15.320 +  (mytab.mapstorage)->coords.set(moved_node, XY(coord_x, coord_y));
  15.321  
  15.322    //all the edges connected to the moved point has to be redrawn
  15.323 -  for(OutEdgeIt ei((mytab.mapstorage).graph,moved_node);ei!=INVALID;++ei)
  15.324 +  for(OutEdgeIt ei((mytab.mapstorage)->graph,moved_node);ei!=INVALID;++ei)
  15.325      {
  15.326        XY arrow_pos;
  15.327  
  15.328 -      if (mytab.mapstorage.graph.source(ei) == mytab.mapstorage.graph.target(ei))
  15.329 +      if (mytab.mapstorage->graph.source(ei) == mytab.mapstorage->graph.target(ei))
  15.330  	{
  15.331 -	  arrow_pos = mytab.mapstorage.arrow_pos[ei] + XY(dx, dy);
  15.332 +	  arrow_pos = mytab.mapstorage->arrow_pos[ei] + XY(dx, dy);
  15.333  	}
  15.334        else
  15.335  	{
  15.336  	  XY moved_node_1(coord_x - dx, coord_y - dy);
  15.337  	  XY moved_node_2(coord_x, coord_y);
  15.338 -	  Node target = mytab.mapstorage.graph.target(ei);
  15.339 -	  XY fix_node(mytab.mapstorage.coords[target].x,
  15.340 -		      mytab.mapstorage.coords[target].y);
  15.341 -	  XY old_arrow_pos(mytab.mapstorage.arrow_pos[ei]);
  15.342 +	  Node target = mytab.mapstorage->graph.target(ei);
  15.343 +	  XY fix_node(mytab.mapstorage->coords[target].x,
  15.344 +		      mytab.mapstorage->coords[target].y);
  15.345 +	  XY old_arrow_pos(mytab.mapstorage->arrow_pos[ei]);
  15.346  
  15.347  	  arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, isbutton);
  15.348  	}
  15.349  
  15.350 -      mytab.mapstorage.arrow_pos.set(ei, arrow_pos);
  15.351 +      mytab.mapstorage->arrow_pos.set(ei, arrow_pos);
  15.352        edgesmap[ei]->draw();
  15.353  
  15.354        //reposition of edgetext
  15.355 -      XY text_pos=mytab.mapstorage.arrow_pos[ei];
  15.356 +      XY text_pos=mytab.mapstorage->arrow_pos[ei];
  15.357        text_pos+=(XY(10,10));
  15.358        edgetextmap[ei]->property_x().set_value(text_pos.x);
  15.359        edgetextmap[ei]->property_y().set_value(text_pos.y);
  15.360      }
  15.361  
  15.362 -  for(InEdgeIt ei((mytab.mapstorage).graph,moved_node);ei!=INVALID;++ei)
  15.363 +  for(InEdgeIt ei((mytab.mapstorage)->graph,moved_node);ei!=INVALID;++ei)
  15.364      {
  15.365 -      if (mytab.mapstorage.graph.source(ei) != mytab.mapstorage.graph.target(ei))
  15.366 +      if (mytab.mapstorage->graph.source(ei) != mytab.mapstorage->graph.target(ei))
  15.367  	{
  15.368  	  XY moved_node_1(coord_x - dx, coord_y - dy);
  15.369  	  XY moved_node_2(coord_x, coord_y);
  15.370 -	  Node source = mytab.mapstorage.graph.source(ei);
  15.371 -	  XY fix_node(mytab.mapstorage.coords[source].x,
  15.372 -		      mytab.mapstorage.coords[source].y);
  15.373 -	  XY old_arrow_pos(mytab.mapstorage.arrow_pos[ei]);
  15.374 +	  Node source = mytab.mapstorage->graph.source(ei);
  15.375 +	  XY fix_node(mytab.mapstorage->coords[source].x,
  15.376 +		      mytab.mapstorage->coords[source].y);
  15.377 +	  XY old_arrow_pos(mytab.mapstorage->arrow_pos[ei]);
  15.378  
  15.379  	  XY arrow_pos;
  15.380  	  arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, isbutton);
  15.381  
  15.382 -	  mytab.mapstorage.arrow_pos.set(ei, arrow_pos);
  15.383 +	  mytab.mapstorage->arrow_pos.set(ei, arrow_pos);
  15.384  	  edgesmap[ei]->draw();
  15.385  
  15.386  	  //reposition of edgetext
  15.387 -	  XY text_pos=mytab.mapstorage.arrow_pos[ei];
  15.388 +	  XY text_pos=mytab.mapstorage->arrow_pos[ei];
  15.389  	  text_pos+=(XY(10,10));
  15.390  	  edgetextmap[ei]->property_x().set_value(text_pos.x);
  15.391  	  edgetextmap[ei]->property_y().set_value(text_pos.y);
    16.1 --- a/graph_displayer_canvas-node.cc	Wed Feb 28 15:19:20 2007 +0000
    16.2 +++ b/graph_displayer_canvas-node.cc	Wed Feb 28 18:20:28 2007 +0000
    16.3 @@ -16,7 +16,9 @@
    16.4   *
    16.5   */
    16.6  
    16.7 -#include "graph_displayer_canvas.h"
    16.8 +#include <graph_displayer_canvas.h>
    16.9 +#include <mapstorage.h>
   16.10 +#include <nbtab.h>
   16.11  #include <cmath>
   16.12  
   16.13  const int minimum_node_radius=5;
   16.14 @@ -25,13 +27,13 @@
   16.15  {
   16.16    Graph::NodeMap<double> * actual_map;
   16.17    double min, max;
   16.18 -  min=(mytab.mapstorage).minOfNodeMap(mapname);
   16.19 -  max=(mytab.mapstorage).maxOfNodeMap(mapname);
   16.20 -  actual_map=((mytab.mapstorage).nodemap_storage)[mapname];
   16.21 +  min=(mytab.mapstorage)->minOfNodeMap(mapname);
   16.22 +  max=(mytab.mapstorage)->maxOfNodeMap(mapname);
   16.23 +  actual_map=((mytab.mapstorage)->nodemap_storage)[mapname];
   16.24  
   16.25    if(node==INVALID)
   16.26      {
   16.27 -      for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   16.28 +      for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
   16.29  	{
   16.30  	  double v=fabs((*actual_map)[i]);
   16.31  	  int w;
   16.32 @@ -103,11 +105,11 @@
   16.33    double min, max;
   16.34    min=node_property_defaults[N_RADIUS];
   16.35    max=node_property_defaults[N_RADIUS];
   16.36 -  Graph::NodeMap<double> actual_map((mytab.mapstorage).graph,node_property_defaults[N_RADIUS]);
   16.37 +  Graph::NodeMap<double> actual_map((mytab.mapstorage)->graph,node_property_defaults[N_RADIUS]);
   16.38    
   16.39    if(node==INVALID)
   16.40      {
   16.41 -      for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   16.42 +      for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
   16.43  	{
   16.44  	  double v=fabs(actual_map[i]);
   16.45  	  int w;
   16.46 @@ -167,17 +169,17 @@
   16.47    //green in RGB
   16.48  
   16.49    Graph::NodeMap<double> * actual_map;
   16.50 -  actual_map=((mytab.mapstorage).nodemap_storage)[mapname];
   16.51 +  actual_map=((mytab.mapstorage)->nodemap_storage)[mapname];
   16.52  
   16.53    double max, min;
   16.54  
   16.55 -  max=(mytab.mapstorage).maxOfNodeMap(mapname);
   16.56 -  min=(mytab.mapstorage).minOfNodeMap(mapname);
   16.57 +  max=(mytab.mapstorage)->maxOfNodeMap(mapname);
   16.58 +  min=(mytab.mapstorage)->minOfNodeMap(mapname);
   16.59  
   16.60    if(node==INVALID)
   16.61      {
   16.62  
   16.63 -      for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   16.64 +      for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
   16.65  	{
   16.66  	  Gdk::Color color;
   16.67  
   16.68 @@ -222,7 +224,7 @@
   16.69    //the minimum of the nodemap to the range of
   16.70    //green in RGB
   16.71  
   16.72 -  Graph::NodeMap<double> actual_map((mytab.mapstorage).graph,node_property_defaults[N_COLOR]);
   16.73 +  Graph::NodeMap<double> actual_map((mytab.mapstorage)->graph,node_property_defaults[N_COLOR]);
   16.74  
   16.75    double max, min;
   16.76  
   16.77 @@ -232,7 +234,7 @@
   16.78    if(node==INVALID)
   16.79      {
   16.80  
   16.81 -      for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   16.82 +      for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
   16.83  	{
   16.84  	  Gdk::Color color;
   16.85  
   16.86 @@ -279,11 +281,11 @@
   16.87    //that is the deleter map
   16.88  
   16.89    Graph::NodeMap<double> * actual_map=NULL;
   16.90 -  actual_map=((mytab.mapstorage).nodemap_storage)[mapname];
   16.91 +  actual_map=((mytab.mapstorage)->nodemap_storage)[mapname];
   16.92  
   16.93    if(node==INVALID)
   16.94      {
   16.95 -      for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   16.96 +      for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
   16.97  	{
   16.98  	  nodemap_to_edit=mapname;
   16.99  	  double number=(*actual_map)[i];
  16.100 @@ -316,7 +318,7 @@
  16.101  
  16.102    if(node==INVALID)
  16.103      {
  16.104 -      for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
  16.105 +      for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
  16.106  	{
  16.107  	  nodemap_to_edit="";
  16.108  	  nodetextmap[i]->property_text().set_value("");
    17.1 --- a/graph_displayer_canvas-zoom.cc	Wed Feb 28 15:19:20 2007 +0000
    17.2 +++ b/graph_displayer_canvas-zoom.cc	Wed Feb 28 18:20:28 2007 +0000
    17.3 @@ -16,7 +16,7 @@
    17.4   *
    17.5   */
    17.6  
    17.7 -#include "graph_displayer_canvas.h"
    17.8 +#include <graph_displayer_canvas.h>
    17.9  #include <cmath>
   17.10  
   17.11  void GraphDisplayerCanvas::zoomIn()
    18.1 --- a/graph_displayer_canvas.cc	Wed Feb 28 15:19:20 2007 +0000
    18.2 +++ b/graph_displayer_canvas.cc	Wed Feb 28 18:20:28 2007 +0000
    18.3 @@ -16,13 +16,15 @@
    18.4   *
    18.5   */
    18.6  
    18.7 -#include "graph_displayer_canvas.h"
    18.8 +#include <mapstorage.h>
    18.9 +#include <nbtab.h>
   18.10 +#include <graph_displayer_canvas.h>
   18.11  #include <lemon/random.h>
   18.12  #include <cmath>
   18.13  
   18.14  GraphDisplayerCanvas::GraphDisplayerCanvas(NoteBookTab & mainw) :
   18.15 -  nodesmap(mainw.mapstorage.graph), edgesmap(mainw.mapstorage.graph), edgetextmap(mainw.mapstorage.graph),
   18.16 -  nodetextmap(mainw.mapstorage.graph), displayed_graph(*(root()), 0, 0),
   18.17 +  nodesmap(mainw.mapstorage->graph), edgesmap(mainw.mapstorage->graph), edgetextmap(mainw.mapstorage->graph),
   18.18 +  nodetextmap(mainw.mapstorage->graph), displayed_graph(*(root()), 0, 0),
   18.19    isbutton(0), active_item(NULL), target_item(NULL), nodemap_to_edit(""),
   18.20    edgemap_to_edit(""), autoscale(true), zoomtrack(false), radius_size(20), edge_width(10),
   18.21    was_redesigned(false), is_drawn(false), mytab(mainw),
   18.22 @@ -49,11 +51,11 @@
   18.23    {
   18.24      delete background;
   18.25    }
   18.26 -  if (mytab.mapstorage.isBackgroundSet())
   18.27 +  if (mytab.mapstorage->isBackgroundSet())
   18.28    {
   18.29      background_set = true;
   18.30      refBackground = Gdk::Pixbuf::create_from_file(
   18.31 -      mytab.mapstorage.getBackgroundFilename());
   18.32 +      mytab.mapstorage->getBackgroundFilename());
   18.33      background = new Gnome::Canvas::Pixbuf(
   18.34          *(root()),
   18.35          0.0 - refBackground->get_width() / 2.0,
   18.36 @@ -69,13 +71,13 @@
   18.37  
   18.38  GraphDisplayerCanvas::~GraphDisplayerCanvas()
   18.39  {
   18.40 -  for (NodeIt n((mytab.mapstorage).graph); n != INVALID; ++n)
   18.41 +  for (NodeIt n((mytab.mapstorage)->graph); n != INVALID; ++n)
   18.42      {
   18.43        delete nodesmap[n];
   18.44        delete nodetextmap[n];
   18.45      }
   18.46    
   18.47 -  for (EdgeIt e((mytab.mapstorage).graph); e != INVALID; ++e)
   18.48 +  for (EdgeIt e((mytab.mapstorage)->graph); e != INVALID; ++e)
   18.49      {
   18.50        delete edgesmap[e];
   18.51        delete edgetextmap[e];
   18.52 @@ -118,7 +120,7 @@
   18.53      {
   18.54        if(mapname!="")
   18.55  	{
   18.56 -	  if( ( ((mytab.mapstorage).nodemap_storage).find(mapname) != ((mytab.mapstorage).nodemap_storage).end() ) )
   18.57 +	  if( ( ((mytab.mapstorage)->nodemap_storage).find(mapname) != ((mytab.mapstorage)->nodemap_storage).end() ) )
   18.58  	    {
   18.59  	      switch(prop)
   18.60  		{
   18.61 @@ -165,7 +167,7 @@
   18.62      {
   18.63        if(mapname!="")
   18.64  	{
   18.65 -	  if( ( ((mytab.mapstorage).edgemap_storage).find(mapname) != ((mytab.mapstorage).edgemap_storage).end() ) )
   18.66 +	  if( ( ((mytab.mapstorage)->edgemap_storage).find(mapname) != ((mytab.mapstorage)->edgemap_storage).end() ) )
   18.67  	    {
   18.68  	      switch(prop)
   18.69  		{
   18.70 @@ -207,9 +209,9 @@
   18.71  {
   18.72    //first edges are drawn, to hide joining with nodes later
   18.73  
   18.74 -  for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   18.75 +  for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
   18.76    {
   18.77 -    if (mytab.mapstorage.graph.source(i) == mytab.mapstorage.graph.target(i))
   18.78 +    if (mytab.mapstorage->graph.source(i) == mytab.mapstorage->graph.target(i))
   18.79      {
   18.80        edgesmap[i]=new LoopEdge(displayed_graph, i, *this);
   18.81      }
   18.82 @@ -219,7 +221,7 @@
   18.83      }
   18.84      //initializing edge-text as well, to empty string
   18.85  
   18.86 -    XY text_pos=mytab.mapstorage.arrow_pos[i];
   18.87 +    XY text_pos=mytab.mapstorage->arrow_pos[i];
   18.88      text_pos+=(XY(10,10));
   18.89  
   18.90      edgetextmap[i]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, "");
   18.91 @@ -230,16 +232,16 @@
   18.92  
   18.93    //afterwards nodes come to be drawn
   18.94  
   18.95 -  for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
   18.96 +  for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
   18.97    {
   18.98      //drawing bule nodes, with black line around them
   18.99  
  18.100      nodesmap[i]=new Gnome::Canvas::Ellipse(
  18.101          displayed_graph,
  18.102 -        (mytab.mapstorage).coords[i].x-20,
  18.103 -        (mytab.mapstorage).coords[i].y-20,
  18.104 -        (mytab.mapstorage).coords[i].x+20,
  18.105 -        (mytab.mapstorage).coords[i].y+20);
  18.106 +        (mytab.mapstorage)->coords[i].x-20,
  18.107 +        (mytab.mapstorage)->coords[i].y-20,
  18.108 +        (mytab.mapstorage)->coords[i].x+20,
  18.109 +        (mytab.mapstorage)->coords[i].y+20);
  18.110      *(nodesmap[i]) << Gnome::Canvas::Properties::fill_color("blue");
  18.111      *(nodesmap[i]) << Gnome::Canvas::Properties::outline_color("black");
  18.112      nodesmap[i]->raise_to_top();
  18.113 @@ -247,8 +249,8 @@
  18.114      //initializing edge-text as well, to empty string
  18.115  
  18.116      XY text_pos(
  18.117 -        ((mytab.mapstorage).coords[i].x+node_property_defaults[N_RADIUS]+5),
  18.118 -        ((mytab.mapstorage).coords[i].y+node_property_defaults[N_RADIUS]+5));
  18.119 +        ((mytab.mapstorage)->coords[i].x+node_property_defaults[N_RADIUS]+5),
  18.120 +        ((mytab.mapstorage)->coords[i].y+node_property_defaults[N_RADIUS]+5));
  18.121  
  18.122      nodetextmap[i]=new Gnome::Canvas::Text(displayed_graph,
  18.123          text_pos.x, text_pos.y, "");
  18.124 @@ -281,13 +283,13 @@
  18.125    active_edge=INVALID;
  18.126    forming_edge=INVALID;
  18.127  
  18.128 -  for (NodeIt n((mytab.mapstorage).graph); n != INVALID; ++n)
  18.129 +  for (NodeIt n((mytab.mapstorage)->graph); n != INVALID; ++n)
  18.130    {
  18.131      delete nodesmap[n];
  18.132      delete nodetextmap[n];
  18.133    }
  18.134  
  18.135 -  for (EdgeIt e((mytab.mapstorage).graph); e != INVALID; ++e)
  18.136 +  for (EdgeIt e((mytab.mapstorage)->graph); e != INVALID; ++e)
  18.137    {
  18.138      delete edgesmap[e];
  18.139      delete edgetextmap[e];
  18.140 @@ -323,7 +325,7 @@
  18.141  
  18.142  void GraphDisplayerCanvas::reDesignGraph()
  18.143  {
  18.144 -  NodeIt firstnode((mytab.mapstorage).graph);
  18.145 +  NodeIt firstnode((mytab.mapstorage)->graph);
  18.146    //is it not an empty graph?
  18.147    if(firstnode!=INVALID)
  18.148      {
  18.149 @@ -333,7 +335,7 @@
  18.150  
  18.151        if(!was_redesigned)
  18.152  	{
  18.153 -	  NodeIt i((mytab.mapstorage).graph);
  18.154 +	  NodeIt i((mytab.mapstorage)->graph);
  18.155  
  18.156  	  dim2::Point<double> init(init_vector_length*rnd(),
  18.157  				   init_vector_length*rnd());
  18.158 @@ -345,28 +347,28 @@
  18.159        double propulsation;
  18.160        int iterations;
  18.161  
  18.162 -      (mytab.mapstorage).get_design_data(attraction, propulsation, iterations);
  18.163 +      (mytab.mapstorage)->get_design_data(attraction, propulsation, iterations);
  18.164  
  18.165        //iteration counter
  18.166        for(int l=0;l<iterations;l++)
  18.167  	{
  18.168 -	  Graph::NodeMap<double> x(mytab.mapstorage.graph);
  18.169 -	  Graph::NodeMap<double> y(mytab.mapstorage.graph);
  18.170 +	  Graph::NodeMap<double> x(mytab.mapstorage->graph);
  18.171 +	  Graph::NodeMap<double> y(mytab.mapstorage->graph);
  18.172  	  XYMap<Graph::NodeMap<double> > actual_forces;
  18.173  	  actual_forces.setXMap(x);
  18.174  	  actual_forces.setYMap(y);
  18.175  
  18.176  	  //count actual force for each nodes
  18.177 -	  for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
  18.178 +	  for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
  18.179  	    {
  18.180  	      //propulsation of nodes
  18.181 -	      for (NodeIt j((mytab.mapstorage).graph); j!=INVALID; ++j)
  18.182 +	      for (NodeIt j((mytab.mapstorage)->graph); j!=INVALID; ++j)
  18.183  		{
  18.184  		  if(i!=j)
  18.185  		    {
  18.186  		      lemon::dim2::Point<double> delta =
  18.187 -			((mytab.mapstorage).coords[i]-
  18.188 -			 (mytab.mapstorage).coords[j]);
  18.189 +			((mytab.mapstorage)->coords[i]-
  18.190 +			 (mytab.mapstorage)->coords[j]);
  18.191  
  18.192  		      const double length_sqr=std::max(delta.normSquare(),min_dist);
  18.193  
  18.194 @@ -381,11 +383,11 @@
  18.195  		    }
  18.196  		}
  18.197  	      //attraction of nodes, to which actual node is bound
  18.198 -	      for(OutEdgeIt ei((mytab.mapstorage).graph,i);ei!=INVALID;++ei)
  18.199 +	      for(OutEdgeIt ei((mytab.mapstorage)->graph,i);ei!=INVALID;++ei)
  18.200  		{
  18.201  		  lemon::dim2::Point<double> delta =
  18.202 -		    ((mytab.mapstorage).coords[i]-
  18.203 -		     (mytab.mapstorage).coords[mytab.mapstorage.
  18.204 +		    ((mytab.mapstorage)->coords[i]-
  18.205 +		     (mytab.mapstorage)->coords[mytab.mapstorage->
  18.206  					       graph.target(ei)]);
  18.207  		
  18.208  		  //calculating attraction strength
  18.209 @@ -394,11 +396,11 @@
  18.210  		
  18.211  		  actual_forces.set(i,actual_forces[i]-delta);
  18.212  		}
  18.213 -	      for(InEdgeIt ei((mytab.mapstorage).graph,i);ei!=INVALID;++ei)
  18.214 +	      for(InEdgeIt ei((mytab.mapstorage)->graph,i);ei!=INVALID;++ei)
  18.215  		{
  18.216  		  lemon::dim2::Point<double> delta =
  18.217 -		    ((mytab.mapstorage).coords[i]-
  18.218 -		     (mytab.mapstorage).coords[mytab.mapstorage.
  18.219 +		    ((mytab.mapstorage)->coords[i]-
  18.220 +		     (mytab.mapstorage)->coords[mytab.mapstorage->
  18.221  					       graph.source(ei)]);
  18.222  		
  18.223  		  //calculating attraction strength
  18.224 @@ -408,27 +410,27 @@
  18.225  		  actual_forces.set(i,actual_forces[i]-delta);
  18.226  		}
  18.227  	    }
  18.228 -	  for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
  18.229 +	  for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i)
  18.230  	    {
  18.231 -	      if(((mytab.mapstorage).coords[i].x)+actual_forces[i].x>max_coord)
  18.232 +	      if(((mytab.mapstorage)->coords[i].x)+actual_forces[i].x>max_coord)
  18.233  		{
  18.234 -		  actual_forces[i].x=max_coord-((mytab.mapstorage).coords[i].x);
  18.235 -		  std::cout << "Correction! " << (((mytab.mapstorage).coords[i].x)+actual_forces[i].x) << std::endl;
  18.236 +		  actual_forces[i].x=max_coord-((mytab.mapstorage)->coords[i].x);
  18.237 +		  std::cout << "Correction! " << (((mytab.mapstorage)->coords[i].x)+actual_forces[i].x) << std::endl;
  18.238  		}
  18.239 -	      else if(((mytab.mapstorage).coords[i].x)+actual_forces[i].x<(0-max_coord))
  18.240 +	      else if(((mytab.mapstorage)->coords[i].x)+actual_forces[i].x<(0-max_coord))
  18.241  		{
  18.242 -		  actual_forces[i].x=0-max_coord-((mytab.mapstorage).coords[i].x);
  18.243 -		  std::cout << "Correction! " << (((mytab.mapstorage).coords[i].x)+actual_forces[i].x) << std::endl;
  18.244 +		  actual_forces[i].x=0-max_coord-((mytab.mapstorage)->coords[i].x);
  18.245 +		  std::cout << "Correction! " << (((mytab.mapstorage)->coords[i].x)+actual_forces[i].x) << std::endl;
  18.246  		}
  18.247 -	      if(((mytab.mapstorage).coords[i].y)+actual_forces[i].y>max_coord)
  18.248 +	      if(((mytab.mapstorage)->coords[i].y)+actual_forces[i].y>max_coord)
  18.249  		{
  18.250 -		  actual_forces[i].y=max_coord-((mytab.mapstorage).coords[i].y);
  18.251 -		  std::cout << "Correction! " << (((mytab.mapstorage).coords[i].y)+actual_forces[i].y) << std::endl;
  18.252 +		  actual_forces[i].y=max_coord-((mytab.mapstorage)->coords[i].y);
  18.253 +		  std::cout << "Correction! " << (((mytab.mapstorage)->coords[i].y)+actual_forces[i].y) << std::endl;
  18.254  		}
  18.255 -	      else if(((mytab.mapstorage).coords[i].y)+actual_forces[i].y<(0-max_coord))
  18.256 +	      else if(((mytab.mapstorage)->coords[i].y)+actual_forces[i].y<(0-max_coord))
  18.257  		{
  18.258 -		  actual_forces[i].y=0-max_coord-((mytab.mapstorage).coords[i].y);
  18.259 -		  std::cout << "Correction! " << (((mytab.mapstorage).coords[i].y)+actual_forces[i].y) << std::endl;
  18.260 +		  actual_forces[i].y=0-max_coord-((mytab.mapstorage)->coords[i].y);
  18.261 +		  std::cout << "Correction! " << (((mytab.mapstorage)->coords[i].y)+actual_forces[i].y) << std::endl;
  18.262  		}
  18.263  	      moveNode(actual_forces[i].x, actual_forces[i].y, nodesmap[i], i);
  18.264  	    }
    19.1 --- a/graph_displayer_canvas.h	Wed Feb 28 15:19:20 2007 +0000
    19.2 +++ b/graph_displayer_canvas.h	Wed Feb 28 18:20:28 2007 +0000
    19.3 @@ -19,13 +19,11 @@
    19.4  #ifndef GRAPH_DISPLAYER_CANVAS_H
    19.5  #define GRAPH_DISPLAYER_CANVAS_H
    19.6  
    19.7 -class GraphDisplayerCanvas;
    19.8 +class NoteBookTab;
    19.9  
   19.10  #include "all_include.h"
   19.11 -#include "nbtab.h"
   19.12  #include <libgnomecanvasmm.h>
   19.13  #include <libgnomecanvasmm/polygon.h>
   19.14 -#include <lemon/dim2.h>
   19.15  
   19.16  ///This class is the canvas, on which the graph can be drawn.
   19.17  class GraphDisplayerCanvas : public Gnome::Canvas::CanvasAA
    20.1 --- a/gui_reader.cc	Wed Feb 28 15:19:20 2007 +0000
    20.2 +++ b/gui_reader.cc	Wed Feb 28 18:20:28 2007 +0000
    20.3 @@ -16,9 +16,10 @@
    20.4   *
    20.5   */
    20.6  
    20.7 -#include "gui_reader.h"
    20.8 -#include "xml.h"
    20.9 -#include "mapstorage.h"
   20.10 +#include <gui_reader.h>
   20.11 +#include <mapstorage.h>
   20.12 +
   20.13 +#include <xml.h>
   20.14  #include <lemon/dim2.h>
   20.15  #include <vector>
   20.16  
    21.1 --- a/gui_reader.h	Wed Feb 28 15:19:20 2007 +0000
    21.2 +++ b/gui_reader.h	Wed Feb 28 18:20:28 2007 +0000
    21.3 @@ -18,9 +18,9 @@
    21.4  
    21.5  #ifndef GUI_READER_H
    21.6  #define GUI_READER_H
    21.7 +#include <lemon/lemon_reader.h>
    21.8  
    21.9 -#include "mapstorage.h"
   21.10 -#include <lemon/lemon_reader.h>
   21.11 +class MapStorage;
   21.12  
   21.13  using lemon::LemonReader;
   21.14  
    22.1 --- a/gui_writer.cc	Wed Feb 28 15:19:20 2007 +0000
    22.2 +++ b/gui_writer.cc	Wed Feb 28 18:20:28 2007 +0000
    22.3 @@ -16,12 +16,13 @@
    22.4   *
    22.5   */
    22.6  
    22.7 -#include "gui_writer.h"
    22.8 -#include "xml.h"
    22.9 -#include "mapstorage.h"
   22.10 +#include <xml.h>
   22.11  #include <lemon/dim2.h>
   22.12  #include <vector>
   22.13  
   22.14 +#include <gui_writer.h>
   22.15 +#include <mapstorage.h>
   22.16 +
   22.17  std::string GuiWriter::header()
   22.18  {
   22.19    return "@gui";
    23.1 --- a/gui_writer.h	Wed Feb 28 15:19:20 2007 +0000
    23.2 +++ b/gui_writer.h	Wed Feb 28 18:20:28 2007 +0000
    23.3 @@ -19,9 +19,10 @@
    23.4  #ifndef GUI_WRITER_H
    23.5  #define GUI_WRITER_H
    23.6  
    23.7 -#include "mapstorage.h"
    23.8  #include <lemon/lemon_writer.h>
    23.9  
   23.10 +class MapStorage;
   23.11 +
   23.12  using lemon::LemonWriter;
   23.13  
   23.14  class GuiWriter : public LemonWriter::SectionWriter
    24.1 --- a/kruskalbox.cc	Wed Feb 28 15:19:20 2007 +0000
    24.2 +++ b/kruskalbox.cc	Wed Feb 28 18:20:28 2007 +0000
    24.3 @@ -16,6 +16,11 @@
    24.4   *
    24.5   */
    24.6  
    24.7 +#include <lemon/kruskal.h>
    24.8 +
    24.9 +#include <mapstorage.h>
   24.10 +#include <mapselector.h>
   24.11 +#include <algobox.h>
   24.12  #include <kruskalbox.h>
   24.13  
   24.14  enum {INPUT, OUTPUT, MAP_NUM};
    25.1 --- a/kruskalbox.h	Wed Feb 28 15:19:20 2007 +0000
    25.2 +++ b/kruskalbox.h	Wed Feb 28 18:20:28 2007 +0000
    25.3 @@ -19,11 +19,9 @@
    25.4  #ifndef KRUSKALBOX_H
    25.5  #define KRUSKALBOX_H
    25.6  
    25.7 -class KruskalBox;
    25.8 +class AlgoBox;
    25.9  
   25.10  #include <all_include.h>
   25.11 -#include <algobox.h>
   25.12 -#include <lemon/kruskal.h>
   25.13  #include <libgnomecanvasmm.h>
   25.14  #include <libgnomecanvasmm/polygon.h>
   25.15  
    26.1 --- a/main_win.cc	Wed Feb 28 15:19:20 2007 +0000
    26.2 +++ b/main_win.cc	Wed Feb 28 18:20:28 2007 +0000
    26.3 @@ -20,9 +20,15 @@
    26.4  #include <config.h>
    26.5  #endif
    26.6  
    26.7 -#include "main_win.h"
    26.8 -#include "guipixbufs.h"
    26.9 -#include "background_chooser_dialog.h"
   26.10 +#include <main_win.h>
   26.11 +#include <guipixbufs.h>
   26.12 +#include <background_chooser_dialog.h>
   26.13 +
   26.14 +#include <mapstorage.h>
   26.15 +#include <graph_displayer_canvas.h>
   26.16 +#include <algowin.h>
   26.17 +#include <new_map_win.h>
   26.18 +#include <nbtab.h>
   26.19  
   26.20  #include "i18n.h"
   26.21  
   26.22 @@ -364,7 +370,7 @@
   26.23  {
   26.24    if(active_tab!=-1)
   26.25      {
   26.26 -      if (tabs[active_tab]->mapstorage.modified)
   26.27 +      if (tabs[active_tab]->mapstorage->modified)
   26.28  	{
   26.29  	  Gtk::MessageDialog mdialog(_("<b>Save changes before closing?</b>"), true, 
   26.30  				     Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE);
   26.31 @@ -553,7 +559,7 @@
   26.32    for(;(i<(int)tabnames.size())&&(tabnames[i]!=tabname);i++)
   26.33      {
   26.34      }
   26.35 -  awp->update_maplist(&(tabs[i]->mapstorage));
   26.36 +  awp->update_maplist(tabs[i]->mapstorage);
   26.37  }
   26.38  
   26.39  void MainWin::deRegisterAlgoWin(AlgoWin * awp)
   26.40 @@ -632,6 +638,6 @@
   26.41  
   26.42  void MainWin::createBackgroundChooser()
   26.43  {
   26.44 -  BackgroundChooserDialog dialog(&(tabs[active_tab]->mapstorage));
   26.45 +  BackgroundChooserDialog dialog(tabs[active_tab]->mapstorage);
   26.46    dialog.run();
   26.47  }
    27.1 --- a/main_win.h	Wed Feb 28 15:19:20 2007 +0000
    27.2 +++ b/main_win.h	Wed Feb 28 18:20:28 2007 +0000
    27.3 @@ -20,13 +20,11 @@
    27.4  #define MAIN_WIN_H
    27.5  
    27.6  #include "all_include.h"
    27.7 -#include "algowin.h"
    27.8 -#include "map_win.h"
    27.9 -#include "new_map_win.h"
   27.10 -#include "nbtab.h"
   27.11  #include <libgnomecanvasmm.h>
   27.12  #include <libgnomecanvasmm/polygon.h>
   27.13  
   27.14 +class AlgoWin;
   27.15 +class NoteBookTab;
   27.16  
   27.17  ///This class is the main window of GUI.
   27.18  
    28.1 --- a/map_win.cc	Wed Feb 28 15:19:20 2007 +0000
    28.2 +++ b/map_win.cc	Wed Feb 28 18:20:28 2007 +0000
    28.3 @@ -16,7 +16,9 @@
    28.4   *
    28.5   */
    28.6  
    28.7 -#include "map_win.h"
    28.8 +#include <map_win.h>
    28.9 +#include <nbtab.h>
   28.10 +#include <mapselector.h>
   28.11  #include <set>
   28.12  
   28.13  bool MapWin::closeIfEscapeIsPressed(GdkEventKey* e)
    29.1 --- a/map_win.h	Wed Feb 28 15:19:20 2007 +0000
    29.2 +++ b/map_win.h	Wed Feb 28 18:20:28 2007 +0000
    29.3 @@ -19,11 +19,10 @@
    29.4  #ifndef MAP_WIN_H
    29.5  #define MAP_WIN_H
    29.6  
    29.7 -class MapWin;
    29.8 +class NoteBookTab;
    29.9 +class MapSelector;
   29.10  
   29.11  #include <all_include.h>
   29.12 -#include <nbtab.h>
   29.13 -#include <mapselector.h>
   29.14  #include <libgnomecanvasmm.h>
   29.15  #include <libgnomecanvasmm/polygon.h>
   29.16  
    30.1 --- a/mapselector.cc	Wed Feb 28 15:19:20 2007 +0000
    30.2 +++ b/mapselector.cc	Wed Feb 28 18:20:28 2007 +0000
    30.3 @@ -16,7 +16,7 @@
    30.4   *
    30.5   */
    30.6  
    30.7 -#include "mapselector.h"
    30.8 +#include <mapselector.h>
    30.9  
   30.10  MapSelector::MapSelector(std::vector<std::string> ml, std::string act, std::string labeltext, bool edge, bool d):def(d),itisedge(edge),set_new_map(false)
   30.11  {
    31.1 --- a/mapselector.h	Wed Feb 28 15:19:20 2007 +0000
    31.2 +++ b/mapselector.h	Wed Feb 28 18:20:28 2007 +0000
    31.3 @@ -19,10 +19,7 @@
    31.4  #ifndef MAPSELECTOR_H
    31.5  #define MAPSELECTOR_H
    31.6  
    31.7 -class MapSelector;
    31.8 -
    31.9  #include <all_include.h>
   31.10 -#include <map_win.h>
   31.11  #include <libgnomecanvasmm.h>
   31.12  #include <libgnomecanvasmm/polygon.h>
   31.13  
    32.1 --- a/mapstorage.cc	Wed Feb 28 15:19:20 2007 +0000
    32.2 +++ b/mapstorage.cc	Wed Feb 28 18:20:28 2007 +0000
    32.3 @@ -16,14 +16,16 @@
    32.4   *
    32.5   */
    32.6  
    32.7 -#include "mapstorage.h"
    32.8 -#include "nbtab.h"
    32.9 -#include "gui_writer.h"
   32.10 -#include "gui_reader.h"
   32.11  #include <limits>
   32.12  #include <cmath>
   32.13  #include <gtkmm.h>
   32.14 -#include<lemon/graph_to_eps.h>
   32.15 +
   32.16 +#include <mapstorage.h>
   32.17 +#include <graph_displayer_canvas.h> //kivenni
   32.18 +#include <nbtab.h> //kivenni
   32.19 +#include <gui_writer.h>
   32.20 +#include <gui_reader.h>
   32.21 +#include <lemon/graph_to_eps.h>
   32.22  
   32.23  const int i_d=20;
   32.24  const double a_d=0.05;
    33.1 --- a/mapstorage.h	Wed Feb 28 15:19:20 2007 +0000
    33.2 +++ b/mapstorage.h	Wed Feb 28 18:20:28 2007 +0000
    33.3 @@ -19,10 +19,8 @@
    33.4  #ifndef MAPSTORAGE_H
    33.5  #define MAPSTORAGE_H
    33.6  
    33.7 -class Mapstorage;
    33.8 -
    33.9 -#include "all_include.h"
   33.10 -#include "xymap.h"
   33.11 +#include <all_include.h>
   33.12 +#include <xymap.h>
   33.13  #include <libgnomecanvasmm.h>
   33.14  
   33.15  class NoteBookTab;
    34.1 --- a/nbtab.cc	Wed Feb 28 15:19:20 2007 +0000
    34.2 +++ b/nbtab.cc	Wed Feb 28 18:20:28 2007 +0000
    34.3 @@ -17,39 +17,47 @@
    34.4   */
    34.5  
    34.6  #include <nbtab.h>
    34.7 +#include <mapstorage.h>
    34.8  #include <eps_win.h>
    34.9 +#include <map_win.h>
   34.10 +#include <design_win.h>
   34.11 +#include <graph_displayer_canvas.h>
   34.12  
   34.13 -NoteBookTab::NoteBookTab():mapwinexists(false), designwinexists(false), mapstorage(*this)
   34.14 +
   34.15 +
   34.16 +NoteBookTab::NoteBookTab():mapwinexists(false), designwinexists(false)
   34.17  {
   34.18 +  mapstorage=new MapStorage(*this);
   34.19 +
   34.20    Gtk::ScrolledWindow *pScrolledWindow = manage(new Gtk::ScrolledWindow);
   34.21    gd_canvas=new GraphDisplayerCanvas(*this);
   34.22    pScrolledWindow->add(*gd_canvas);
   34.23    add(*pScrolledWindow);
   34.24  
   34.25    //connecting signals - controller character
   34.26 -  mapstorage.signal_prop_ch().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::propertyChange));
   34.27 -  mapstorage.signal_node_map_ch().connect(sigc::mem_fun(*this, &NoteBookTab::registerNewNodeMap));
   34.28 -  mapstorage.signal_edge_map_ch().connect(sigc::mem_fun(*this, &NoteBookTab::registerNewEdgeMap));
   34.29 +  mapstorage->signal_prop_ch().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::propertyChange));
   34.30 +  mapstorage->signal_node_map_ch().connect(sigc::mem_fun(*this, &NoteBookTab::registerNewNodeMap));
   34.31 +  mapstorage->signal_edge_map_ch().connect(sigc::mem_fun(*this, &NoteBookTab::registerNewEdgeMap));
   34.32    show_all_children();
   34.33    show();
   34.34  }
   34.35  
   34.36  void NoteBookTab::readFile(const std::string &file)
   34.37  {
   34.38 -  mapstorage.readFromFile(file);
   34.39 -  mapstorage.file_name = file;
   34.40 -  mapstorage.modified = false;
   34.41 +  mapstorage->readFromFile(file);
   34.42 +  mapstorage->file_name = file;
   34.43 +  mapstorage->modified = false;
   34.44    gd_canvas->drawGraph();
   34.45    if(mapwinexists)
   34.46      {
   34.47 -      mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList());
   34.48 +      mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList());
   34.49      }
   34.50    signal_title.emit(Glib::filename_display_basename(file));
   34.51  }
   34.52  
   34.53  void NoteBookTab::newFile()
   34.54  {
   34.55 -  if (mapstorage.modified)
   34.56 +  if (mapstorage->modified)
   34.57    {
   34.58      Gtk::MessageDialog mdialog("<b>Save changes before closing?</b>", true,
   34.59          Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE);
   34.60 @@ -68,17 +76,17 @@
   34.61      }
   34.62    }
   34.63    gd_canvas->clear();
   34.64 -  mapstorage.clear();
   34.65 +  mapstorage->clear();
   34.66    if(mapwinexists)
   34.67      {
   34.68 -      mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList());
   34.69 +      mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList());
   34.70      }
   34.71    signal_title.emit("unsaved file");
   34.72  }
   34.73  
   34.74  void NoteBookTab::openFile()
   34.75  {
   34.76 -  if (mapstorage.modified)
   34.77 +  if (mapstorage->modified)
   34.78    {
   34.79      Gtk::MessageDialog mdialog("<b>Save changes before closing?</b>", true, 
   34.80          Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE);
   34.81 @@ -102,16 +110,16 @@
   34.82    if (fcdialog.run() == Gtk::RESPONSE_ACCEPT)
   34.83    {
   34.84      gd_canvas->clear();
   34.85 -    mapstorage.clear();
   34.86 +    mapstorage->clear();
   34.87      Glib::ustring filename = fcdialog.get_filename();
   34.88 -    if (!mapstorage.readFromFile(filename))
   34.89 +    if (!mapstorage->readFromFile(filename))
   34.90      {
   34.91 -      mapstorage.file_name = filename;
   34.92 -      mapstorage.modified = false;
   34.93 +      mapstorage->file_name = filename;
   34.94 +      mapstorage->modified = false;
   34.95        gd_canvas->drawGraph();
   34.96        if(mapwinexists)
   34.97  	{
   34.98 -	  mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList());
   34.99 +	  mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList());
  34.100  	}
  34.101        signal_title.emit(Glib::filename_display_basename(filename));
  34.102      }
  34.103 @@ -120,14 +128,14 @@
  34.104  
  34.105  void NoteBookTab::saveFile()
  34.106  {
  34.107 -  if (mapstorage.file_name == "") {
  34.108 +  if (mapstorage->file_name == "") {
  34.109      saveFileAs();
  34.110    }
  34.111    else
  34.112    {
  34.113 -    mapstorage.writeToFile(mapstorage.file_name);
  34.114 -    mapstorage.modified = false;
  34.115 -    signal_title.emit(Glib::filename_display_basename(mapstorage.file_name));
  34.116 +    mapstorage->writeToFile(mapstorage->file_name);
  34.117 +    mapstorage->modified = false;
  34.118 +    signal_title.emit(Glib::filename_display_basename(mapstorage->file_name));
  34.119    }
  34.120  }
  34.121  
  34.122 @@ -139,16 +147,16 @@
  34.123    if (fcdialog.run() == Gtk::RESPONSE_ACCEPT)
  34.124    {
  34.125      Glib::ustring filename = fcdialog.get_filename();
  34.126 -    mapstorage.file_name = filename;
  34.127 -    mapstorage.writeToFile(filename);
  34.128 -    mapstorage.modified = false;
  34.129 +    mapstorage->file_name = filename;
  34.130 +    mapstorage->writeToFile(filename);
  34.131 +    mapstorage->modified = false;
  34.132      signal_title.emit(Glib::filename_display_basename(filename));
  34.133    }
  34.134  }
  34.135  
  34.136  void NoteBookTab::close()
  34.137  {
  34.138 -  if (mapstorage.modified)
  34.139 +  if (mapstorage->modified)
  34.140    {
  34.141      Gtk::MessageDialog mdialog("<b>Save changes before closing?</b>", true,
  34.142          Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE);
  34.143 @@ -167,17 +175,17 @@
  34.144      }
  34.145    }
  34.146    gd_canvas->clear();
  34.147 -  mapstorage.clear();
  34.148 +  mapstorage->clear();
  34.149    if(mapwinexists)
  34.150      {
  34.151 -      mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList());
  34.152 +      mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList());
  34.153      }
  34.154    signal_title.emit("unsaved file");
  34.155  }
  34.156  
  34.157  void NoteBookTab::propertyChange(bool itisedge, int prop, std::string mapname)
  34.158  {
  34.159 -  mapstorage.changeActiveMap(itisedge, prop, mapname);
  34.160 +  mapstorage->changeActiveMap(itisedge, prop, mapname);
  34.161  }
  34.162  
  34.163  sigc::signal<void, NoteBookTab *, bool> NoteBookTab::signal_newmap_needed()
  34.164 @@ -192,12 +200,12 @@
  34.165  
  34.166  std::string NoteBookTab::getActiveEdgeMap(int prop)
  34.167  {
  34.168 -  return mapstorage.getActiveEdgeMap(prop);
  34.169 +  return mapstorage->getActiveEdgeMap(prop);
  34.170  }
  34.171  
  34.172  std::string NoteBookTab::getActiveNodeMap(int prop)
  34.173  {
  34.174 -  return mapstorage.getActiveNodeMap(prop);
  34.175 +  return mapstorage->getActiveNodeMap(prop);
  34.176  }
  34.177  
  34.178  void NoteBookTab::registerNewEdgeMap(std::string mapname)
  34.179 @@ -220,8 +228,8 @@
  34.180  {
  34.181    if(!mapwinexists)
  34.182      {
  34.183 -      mapwin=new MapWin("Map Setup - "+name, mapstorage.getEdgeMapList(), mapstorage.getNodeMapList(), *this);
  34.184 -      mapst2mapwin=mapstorage.signal_map_win_ch().connect(sigc::mem_fun(*mapwin, &MapWin::changeEntry));
  34.185 +      mapwin=new MapWin("Map Setup - "+name, mapstorage->getEdgeMapList(), mapstorage->getNodeMapList(), *this);
  34.186 +      mapst2mapwin=mapstorage->signal_map_win_ch().connect(sigc::mem_fun(*mapwin, &MapWin::changeEntry));
  34.187        mapwin->show();
  34.188        mapwinexists=true;
  34.189      }
  34.190 @@ -244,7 +252,7 @@
  34.191      {
  34.192        double attraction, propulsation;
  34.193        int iterations;
  34.194 -      mapstorage.get_design_data(attraction, propulsation, iterations);
  34.195 +      mapstorage->get_design_data(attraction, propulsation, iterations);
  34.196        designwin=new DesignWin("Design Setup - "+name, attraction, propulsation, iterations, *this);
  34.197  
  34.198        designwin->signal_attraction().connect(sigc::mem_fun(mapstorage, &MapStorage::set_attraction));
  34.199 @@ -254,7 +262,7 @@
  34.200  
  34.201        designwin->signal_delete_event().connect(sigc::mem_fun(*this, &NoteBookTab::closeDesignWin));
  34.202  
  34.203 -      mapst2designwin=mapstorage.signal_design_win_ch().connect(sigc::mem_fun(*designwin, &DesignWin::set_data));
  34.204 +      mapst2designwin=mapstorage->signal_design_win_ch().connect(sigc::mem_fun(*designwin, &DesignWin::set_data));
  34.205  
  34.206        designwin->show();
  34.207        designwinexists=true;
  34.208 @@ -306,10 +314,10 @@
  34.209  
  34.210  void NoteBookTab::active_maps_needed()
  34.211  {
  34.212 -  mapstorage.broadcastActiveMaps();
  34.213 +  mapstorage->broadcastActiveMaps();
  34.214  }
  34.215  
  34.216  void NoteBookTab::exportGraphToEPS(std::vector<bool> options, std::string filename)
  34.217  {
  34.218 -  mapstorage.exportGraphToEPS(options, filename);
  34.219 +  mapstorage->exportGraphToEPS(options, filename);
  34.220  }
    35.1 --- a/nbtab.h	Wed Feb 28 15:19:20 2007 +0000
    35.2 +++ b/nbtab.h	Wed Feb 28 18:20:28 2007 +0000
    35.3 @@ -19,14 +19,12 @@
    35.4  #ifndef NBTAB_H
    35.5  #define NBTAB_H
    35.6  
    35.7 -class NoteBookTab;
    35.8 +class MapStorage;
    35.9 +class EpsWin;
   35.10 +class MapWin;
   35.11 +class DesignWin;
   35.12 +class GraphDisplayerCanvas;
   35.13  
   35.14 -#include "mapstorage.h"
   35.15 -#include "map_win.h"
   35.16 -//#include "eps_win.h"
   35.17 -class EpsWin;
   35.18 -#include "design_win.h"
   35.19 -#include "graph_displayer_canvas.h"
   35.20  #include <libgnomecanvasmm.h>
   35.21  #include <libgnomecanvasmm/polygon.h>
   35.22  
   35.23 @@ -59,7 +57,7 @@
   35.24    NoteBookTab();
   35.25    
   35.26    ///Maps assigned to the graph displayed in this \ref NoteBookTab of notebook.
   35.27 -  MapStorage mapstorage;
   35.28 +  MapStorage * mapstorage;
   35.29      
   35.30    ///Title changement indicator.
   35.31  
    36.1 --- a/new_map_win.cc	Wed Feb 28 15:19:20 2007 +0000
    36.2 +++ b/new_map_win.cc	Wed Feb 28 18:20:28 2007 +0000
    36.3 @@ -17,6 +17,8 @@
    36.4   */
    36.5  
    36.6  #include <new_map_win.h>
    36.7 +#include <nbtab.h>
    36.8 +#include <mapstorage.h>
    36.9  
   36.10  bool NewMapWin::closeIfEscapeIsPressed(GdkEventKey* e)
   36.11  {
   36.12 @@ -119,13 +121,13 @@
   36.13  	  if(edge.get_active())
   36.14  	    {
   36.15  	      //create the new map
   36.16 -	      Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> (mytab.mapstorage.graph, def_val);
   36.17 +	      Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> (mytab.mapstorage->graph, def_val);
   36.18  	      
   36.19  	      if(!only_nums)
   36.20  		{
   36.21  		  std::stack<double> polishstack;
   36.22  		  
   36.23 -		  for(EdgeIt k(mytab.mapstorage.graph); k!=INVALID; ++k)
   36.24 +		  for(EdgeIt k(mytab.mapstorage->graph); k!=INVALID; ++k)
   36.25  		    {
   36.26  		      for(int i=0;i<(int)polishform.size();i++)
   36.27  			{
   36.28 @@ -144,11 +146,11 @@
   36.29  			      break;
   36.30  			    default:
   36.31  			      //substitute variable
   36.32 -			      std::map< std::string,Graph::EdgeMap<double> * > ems=mytab.mapstorage.edgemap_storage;
   36.33 +			      std::map< std::string,Graph::EdgeMap<double> * > ems=mytab.mapstorage->edgemap_storage;
   36.34  			      bool itisvar=(ems.find(ch2var[ polishform[i] ])!=ems.end());
   36.35  			      if(itisvar)
   36.36  				{
   36.37 -				  polishstack.push( (*(mytab.mapstorage.edgemap_storage[ ch2var[ polishform[i] ] ]))[k]);
   36.38 +				  polishstack.push( (*(mytab.mapstorage->edgemap_storage[ ch2var[ polishform[i] ] ]))[k]);
   36.39  				}
   36.40  			      else
   36.41  				{
   36.42 @@ -187,7 +189,7 @@
   36.43  
   36.44  	      //if addition was not successful addEdgeMap returns one.
   36.45  	      //cause can be that there is already a map named like the new one
   36.46 -	      if(mytab.mapstorage.addEdgeMap(mapname, emptr, def_val))
   36.47 +	      if(mytab.mapstorage->addEdgeMap(mapname, emptr, def_val))
   36.48  		{
   36.49  		  abortion=1;
   36.50  		}
   36.51 @@ -202,13 +204,13 @@
   36.52  	  else //!edge.get_active()
   36.53  	    {
   36.54  	      //create the new map
   36.55 -	      Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> (mytab.mapstorage.graph, def_val);
   36.56 +	      Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> (mytab.mapstorage->graph, def_val);
   36.57  
   36.58  	      if(!only_nums)
   36.59  		{
   36.60  		  std::stack<double> polishstack;
   36.61    
   36.62 -		  for(NodeIt k(mytab.mapstorage.graph); k!=INVALID; ++k)
   36.63 +		  for(NodeIt k(mytab.mapstorage->graph); k!=INVALID; ++k)
   36.64  		    {
   36.65  		      for(int i=0;i<(int)polishform.size();i++)
   36.66  			{
   36.67 @@ -226,11 +228,11 @@
   36.68  			      polishstack.pop();
   36.69  			      break;
   36.70  			    default:
   36.71 -			      std::map< std::string,Graph::NodeMap<double> * > nms=mytab.mapstorage.nodemap_storage;
   36.72 +			      std::map< std::string,Graph::NodeMap<double> * > nms=mytab.mapstorage->nodemap_storage;
   36.73  			      bool itisvar=(nms.find(ch2var[ polishform[i] ])!=nms.end());
   36.74  			      if(itisvar)
   36.75  				{
   36.76 -				  polishstack.push( (*(mytab.mapstorage.nodemap_storage[ ch2var[ polishform[i] ] ]))[k]);
   36.77 +				  polishstack.push( (*(mytab.mapstorage->nodemap_storage[ ch2var[ polishform[i] ] ]))[k]);
   36.78  				}
   36.79  			      else
   36.80  				{
   36.81 @@ -268,7 +270,7 @@
   36.82  		}
   36.83  	      //if addition was not successful addNodeMap returns one.
   36.84  	      //cause can be that there is already a map named like the new one
   36.85 -	      if(mytab.mapstorage.addNodeMap(mapname,emptr, def_val))
   36.86 +	      if(mytab.mapstorage->addNodeMap(mapname,emptr, def_val))
   36.87  		{
   36.88  		  abortion=1;
   36.89  		}
   36.90 @@ -479,11 +481,11 @@
   36.91    //is it mapname?
   36.92    if(itisedge)
   36.93      {
   36.94 -      cancel=(mytab.mapstorage.edgemap_storage.find(variable)==mytab.mapstorage.edgemap_storage.end());
   36.95 +      cancel=(mytab.mapstorage->edgemap_storage.find(variable)==mytab.mapstorage->edgemap_storage.end());
   36.96      }
   36.97    else
   36.98      {
   36.99 -      cancel=(mytab.mapstorage.nodemap_storage.find(variable)==mytab.mapstorage.nodemap_storage.end());
  36.100 +      cancel=(mytab.mapstorage->nodemap_storage.find(variable)==mytab.mapstorage->nodemap_storage.end());
  36.101      }
  36.102    //maybe it is number
  36.103    int point_num=0;
    37.1 --- a/new_map_win.h	Wed Feb 28 15:19:20 2007 +0000
    37.2 +++ b/new_map_win.h	Wed Feb 28 18:20:28 2007 +0000
    37.3 @@ -19,14 +19,13 @@
    37.4  #ifndef NEWMAPWIN_H
    37.5  #define NEWMAPWIN_H
    37.6  
    37.7 -class NewMapWin;
    37.8 -
    37.9  #include <all_include.h>
   37.10 -#include <nbtab.h>
   37.11  #include <libgnomecanvasmm.h>
   37.12  #include <libgnomecanvasmm/polygon.h>
   37.13  #include <stack>
   37.14  
   37.15 +class NoteBookTab;
   37.16 +
   37.17  ///Graphical interface for node/edge map creation.
   37.18  
   37.19  ///This class is responsible for creating a window,