# HG changeset patch # User hegyi # Date 1172686828 0 # Node ID 6b2b718420eb66ad3268b5a1b5f2788d739d444c # Parent 2a9a5d7f1a16245905e9ea1c5424122a88a9674d Header reorganising diff -r 2a9a5d7f1a16 -r 6b2b718420eb algobox.cc --- a/algobox.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/algobox.cc Wed Feb 28 18:20:28 2007 +0000 @@ -17,6 +17,8 @@ */ #include +#include +#include enum {N_DEMO1, N_DEMO2, NODE_INPUT_NUM}; // input IDs for nodes; enum {E_DEMO1, EDGE_INPUT_NUM}; // input IDs for edges; diff -r 2a9a5d7f1a16 -r 6b2b718420eb algobox.h --- a/algobox.h Wed Feb 28 15:19:20 2007 +0000 +++ b/algobox.h Wed Feb 28 18:20:28 2007 +0000 @@ -19,11 +19,10 @@ #ifndef ALGOBOX_H #define ALGOBOX_H -class AlgoBox; +class MapStorage; +class MapSelector; #include -#include -#include #include #include diff -r 2a9a5d7f1a16 -r 6b2b718420eb algowin.cc --- a/algowin.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/algowin.cc Wed Feb 28 18:20:28 2007 +0000 @@ -17,6 +17,7 @@ */ #include +#include #include #include diff -r 2a9a5d7f1a16 -r 6b2b718420eb algowin.h --- a/algowin.h Wed Feb 28 15:19:20 2007 +0000 +++ b/algowin.h Wed Feb 28 18:20:28 2007 +0000 @@ -19,14 +19,11 @@ #ifndef ALGOWIN_H #define ALGOWIN_H -class AlgoWin; - #include -//#include -#include #include #include +class AlgoBox; class MapStorage; ///Algorithm identifiers. diff -r 2a9a5d7f1a16 -r 6b2b718420eb background_chooser_dialog.cc --- a/background_chooser_dialog.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/background_chooser_dialog.cc Wed Feb 28 18:20:28 2007 +0000 @@ -1,6 +1,6 @@ -#include "background_chooser_dialog.h" +#include #include -#include "mapstorage.h" +#include BackgroundChooserDialog::BackgroundChooserDialog(MapStorage* ms) : mapstorage(ms), diff -r 2a9a5d7f1a16 -r 6b2b718420eb design_win.cc --- a/design_win.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/design_win.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,6 +16,7 @@ * */ +#include #include bool DesignWin::closeIfEscapeIsPressed(GdkEventKey* e) diff -r 2a9a5d7f1a16 -r 6b2b718420eb design_win.h --- a/design_win.h Wed Feb 28 15:19:20 2007 +0000 +++ b/design_win.h Wed Feb 28 18:20:28 2007 +0000 @@ -19,10 +19,9 @@ #ifndef DESWIN_H #define DESWIN_H -class DesignWin; +class NoteBookTab; #include -#include #include #include diff -r 2a9a5d7f1a16 -r 6b2b718420eb dijkstrabox.cc --- a/dijkstrabox.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/dijkstrabox.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,7 +16,11 @@ * */ +#include +#include +#include #include + #include #include #include diff -r 2a9a5d7f1a16 -r 6b2b718420eb dijkstrabox.h --- a/dijkstrabox.h Wed Feb 28 15:19:20 2007 +0000 +++ b/dijkstrabox.h Wed Feb 28 18:20:28 2007 +0000 @@ -19,10 +19,9 @@ #ifndef DIJKSTRABOX_H #define DIJKSTRABOX_H -class DijkstraBox; +class AlgoBox; #include -#include #include #include diff -r 2a9a5d7f1a16 -r 6b2b718420eb eps_win.cc --- a/eps_win.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/eps_win.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,7 +16,8 @@ * */ -#include "eps_win.h" +#include +#include #include bool EpsWin::closeIfEscapeIsPressed(GdkEventKey* e) diff -r 2a9a5d7f1a16 -r 6b2b718420eb eps_win.h --- a/eps_win.h Wed Feb 28 15:19:20 2007 +0000 +++ b/eps_win.h Wed Feb 28 18:20:28 2007 +0000 @@ -19,11 +19,9 @@ #ifndef EPS_WIN_H #define EPS_WIN_H -class EpsWin; +class NoteBookTab; #include -#include -#include #include #include diff -r 2a9a5d7f1a16 -r 6b2b718420eb gdc-broken_edge.cc --- a/gdc-broken_edge.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/gdc-broken_edge.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,7 +16,9 @@ * */ -#include "graph_displayer_canvas.h" +#include +#include +#include #include GraphDisplayerCanvas::EdgeBase::EdgeBase(Gnome::Canvas::Group& _group, Edge _edge, GraphDisplayerCanvas& _canvas) : @@ -33,7 +35,7 @@ void GraphDisplayerCanvas::EdgeBase::drawArrow(XY unit_vector_in_dir) { - MapStorage& ms = canvas.mytab.mapstorage; + MapStorage& ms = *canvas.mytab.mapstorage; XY center(ms.arrow_pos[edge]); XY unit_norm_vector(0-unit_vector_in_dir.y, unit_vector_in_dir.x); @@ -84,7 +86,7 @@ void GraphDisplayerCanvas::BrokenEdge::draw() { - MapStorage& ms = canvas.mytab.mapstorage; + MapStorage& ms = *canvas.mytab.mapstorage; //calculating coordinates of the direction indicator arrow XY head(ms.coords[ms.graph.target(edge)]); @@ -150,10 +152,10 @@ Gnome::Canvas::Points points_new; - canvas.mytab.mapstorage.arrow_pos.set(edge, canvas.mytab.mapstorage.arrow_pos[edge] + XY(dx, dy)); + canvas.mytab.mapstorage->arrow_pos.set(edge, canvas.mytab.mapstorage->arrow_pos[edge] + XY(dx, dy)); draw(); - canvas.textReposition(canvas.mytab.mapstorage.arrow_pos[edge]); + canvas.textReposition(canvas.mytab.mapstorage->arrow_pos[edge]); clicked_x=e->motion.x; clicked_y=e->motion.y; @@ -194,7 +196,7 @@ void GraphDisplayerCanvas::LoopEdge::draw() { - MapStorage& ms = canvas.mytab.mapstorage; + MapStorage& ms = *canvas.mytab.mapstorage; Node node = ms.graph.source(edge); XY center = (ms.coords[node] + ms.arrow_pos[edge]) / 2.0; @@ -247,10 +249,10 @@ case GDK_MOTION_NOTIFY: if(isbutton) { - canvas.mytab.mapstorage.arrow_pos.set(edge, XY(e->motion.x, e->motion.y)); + canvas.mytab.mapstorage->arrow_pos.set(edge, XY(e->motion.x, e->motion.y)); draw(); - canvas.textReposition(canvas.mytab.mapstorage.arrow_pos[edge]); + canvas.textReposition(canvas.mytab.mapstorage->arrow_pos[edge]); } default: break; } diff -r 2a9a5d7f1a16 -r 6b2b718420eb graph-displayer.cc --- a/graph-displayer.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/graph-displayer.cc Wed Feb 28 18:20:28 2007 +0000 @@ -21,7 +21,6 @@ #endif #include "all_include.h" -#include "mapstorage.h" #include "main_win.h" #include #include diff -r 2a9a5d7f1a16 -r 6b2b718420eb graph_displayer_canvas-edge.cc --- a/graph_displayer_canvas-edge.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/graph_displayer_canvas-edge.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,7 +16,9 @@ * */ -#include "graph_displayer_canvas.h" +#include +#include +#include #include const int minimum_edge_width=0; @@ -27,11 +29,11 @@ min=edge_property_defaults[E_WIDTH]; max=edge_property_defaults[E_WIDTH]; - Graph::EdgeMap actual_map((mytab.mapstorage).graph,edge_property_defaults[E_WIDTH]); + Graph::EdgeMap actual_map((mytab.mapstorage)->graph,edge_property_defaults[E_WIDTH]); if(edge==INVALID) { - for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { double v=fabs(actual_map[i]); int w; @@ -68,13 +70,13 @@ Graph::EdgeMap * actual_map; double min, max; - min=(mytab.mapstorage).minOfEdgeMap(mapname); - max=(mytab.mapstorage).maxOfEdgeMap(mapname); - actual_map=((mytab.mapstorage).edgemap_storage)[mapname]; + min=(mytab.mapstorage)->minOfEdgeMap(mapname); + max=(mytab.mapstorage)->maxOfEdgeMap(mapname); + actual_map=((mytab.mapstorage)->edgemap_storage)[mapname]; if(edge==INVALID) { - for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { double v=(*actual_map)[i]; int w; @@ -131,16 +133,16 @@ //the minimum of the nodemap to the range of //green in RGB Graph::EdgeMap * actual_map; - actual_map=((mytab.mapstorage).edgemap_storage)[mapname]; + actual_map=((mytab.mapstorage)->edgemap_storage)[mapname]; double max, min; - max=(mytab.mapstorage).maxOfEdgeMap(mapname); - min=(mytab.mapstorage).minOfEdgeMap(mapname); + max=(mytab.mapstorage)->maxOfEdgeMap(mapname); + min=(mytab.mapstorage)->minOfEdgeMap(mapname); if(edge==INVALID) { - for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { double w=(*actual_map)[i]; @@ -182,7 +184,7 @@ //function maps the range of the maximum and //the minimum of the nodemap to the range of //green in RGB - Graph::EdgeMap actual_map((mytab.mapstorage).graph,edge_property_defaults[E_COLOR]); + Graph::EdgeMap actual_map((mytab.mapstorage)->graph,edge_property_defaults[E_COLOR]); double max, min; @@ -191,7 +193,7 @@ if(edge==INVALID) { - for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { double w=actual_map[i]; @@ -236,10 +238,10 @@ if(edge==INVALID) { - for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { edgemap_to_edit=mapname; - double number=(*((mytab.mapstorage).edgemap_storage)[mapname])[i]; + double number=(*((mytab.mapstorage)->edgemap_storage)[mapname])[i]; std::ostringstream ostr; ostr << number; @@ -250,7 +252,7 @@ } else { - double number=(*((mytab.mapstorage).edgemap_storage)[mapname])[edge]; + double number=(*((mytab.mapstorage)->edgemap_storage)[mapname])[edge]; std::ostringstream ostr; ostr << number; @@ -271,7 +273,7 @@ if(edge==INVALID) { - for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { edgemap_to_edit=""; edgetextmap[i]->property_text().set_value(""); diff -r 2a9a5d7f1a16 -r 6b2b718420eb graph_displayer_canvas-event.cc --- a/graph_displayer_canvas-event.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/graph_displayer_canvas-event.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,7 +16,9 @@ * */ -#include "graph_displayer_canvas.h" +#include +#include +#include #include @@ -145,7 +147,7 @@ active_item=(get_item_at(clicked_x, clicked_y)); active_node=INVALID; - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { if(nodesmap[i]==active_item) { @@ -168,7 +170,7 @@ //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 if(active_node!=INVALID) { - (mytab.mapstorage).modified = true; + (mytab.mapstorage)->modified = true; //new coordinates will be the old values, //because the item will be moved to the @@ -190,25 +192,25 @@ // reposition the coordinates text std::ostringstream ostr; ostr << "(" << - (mytab.mapstorage).coords[active_node].x << ", " << - (mytab.mapstorage).coords[active_node].y << ")"; + (mytab.mapstorage)->coords[active_node].x << ", " << + (mytab.mapstorage)->coords[active_node].y << ")"; double radius = (nodesmap[active_node]->property_x2().get_value() - nodesmap[active_node]->property_x1().get_value()) / 2.0; if (coord_text) { coord_text->property_text().set_value(ostr.str()); - coord_text->property_x().set_value((mytab.mapstorage).coords[active_node].x + + coord_text->property_x().set_value((mytab.mapstorage)->coords[active_node].x + radius); - coord_text->property_y().set_value((mytab.mapstorage).coords[active_node].y - + coord_text->property_y().set_value((mytab.mapstorage)->coords[active_node].y - radius); } else { coord_text = new Gnome::Canvas::Text( displayed_graph, - (mytab.mapstorage).coords[active_node].x + radius, - (mytab.mapstorage).coords[active_node].y - radius, + (mytab.mapstorage)->coords[active_node].x + radius, + (mytab.mapstorage)->coords[active_node].y - radius, ostr.str()); coord_text->property_fill_color().set_value("black"); coord_text->property_anchor().set_value(Gtk::ANCHOR_SOUTH_WEST); @@ -299,35 +301,35 @@ } case GDK_BUTTON_RELEASE: - (mytab.mapstorage).modified = true; + (mytab.mapstorage)->modified = true; is_drawn=true; isbutton=1; - active_node=(mytab.mapstorage).graph.addNode(); + active_node=(mytab.mapstorage)->graph.addNode(); //initiating values corresponding to new node in maps window_to_world (e->button.x, e->button.y, clicked_x, clicked_y); // update coordinates - (mytab.mapstorage).coords.set(active_node, XY(clicked_x, clicked_y)); + (mytab.mapstorage)->coords.set(active_node, XY(clicked_x, clicked_y)); // update all other maps for (std::map*>::const_iterator it = - (mytab.mapstorage).nodemap_storage.begin(); it != - (mytab.mapstorage).nodemap_storage.end(); ++it) + (mytab.mapstorage)->nodemap_storage.begin(); it != + (mytab.mapstorage)->nodemap_storage.end(); ++it) { if ((it->first != "coordinates_x") && (it->first != "coordinates_y")) { (*(it->second))[active_node] = - (mytab.mapstorage).nodemap_default[it->first]; + (mytab.mapstorage)->nodemap_default[it->first]; } } // increment the id map's default value - (mytab.mapstorage).nodemap_default["label"] += 1.0; + (mytab.mapstorage)->nodemap_default["label"] += 1.0; nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph, clicked_x-20, clicked_y-20, clicked_x+20, clicked_y+20); @@ -377,7 +379,7 @@ active_item=(get_item_at(clicked_x, clicked_y)); active_node=INVALID; - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { if(nodesmap[i]==active_item) { @@ -406,7 +408,7 @@ window_to_world (e->button.x, e->button.y, clicked_x, clicked_y); target_item=(get_item_at(clicked_x, clicked_y)); Node target_node=INVALID; - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { if(nodesmap[i]==target_item) { @@ -416,31 +418,31 @@ //the clicked item is a node, the edge can be drawn if(target_node!=INVALID) { - (mytab.mapstorage).modified = true; + (mytab.mapstorage)->modified = true; *(nodesmap[target_node]) << Gnome::Canvas::Properties::fill_color("red"); //creating new edge - active_edge=(mytab.mapstorage).graph.addEdge(active_node, + active_edge=(mytab.mapstorage)->graph.addEdge(active_node, target_node); // update maps for (std::map*>::const_iterator it = - (mytab.mapstorage).edgemap_storage.begin(); it != - (mytab.mapstorage).edgemap_storage.end(); ++it) + (mytab.mapstorage)->edgemap_storage.begin(); it != + (mytab.mapstorage)->edgemap_storage.end(); ++it) { (*(it->second))[active_edge] = - (mytab.mapstorage).edgemap_default[it->first]; + (mytab.mapstorage)->edgemap_default[it->first]; } // increment the id map's default value - (mytab.mapstorage).edgemap_default["label"] += 1.0; + (mytab.mapstorage)->edgemap_default["label"] += 1.0; if(target_node!=active_node) { // set the coordinates of the arrow on the new edge - MapStorage& ms = mytab.mapstorage; + MapStorage& ms = *mytab.mapstorage; ms.arrow_pos.set(active_edge, (ms.coords[ms.graph.source(active_edge)] + ms.coords[ms.graph.target(active_edge)])/ 2.0); @@ -452,7 +454,7 @@ else { // set the coordinates of the arrow on the new edge - MapStorage& ms = mytab.mapstorage; + MapStorage& ms = *mytab.mapstorage; ms.arrow_pos.set(active_edge, (ms.coords[ms.graph.source(active_edge)] + XY(0.0, 80.0))); @@ -463,7 +465,7 @@ } //initializing edge-text as well, to empty string - XY text_pos=mytab.mapstorage.arrow_pos[active_edge]; + XY text_pos=mytab.mapstorage->arrow_pos[active_edge]; text_pos+=(XY(10,10)); edgetextmap[active_edge]=new Gnome::Canvas::Text(displayed_graph, @@ -497,7 +499,7 @@ } if(target_item) { - propertyUpdate((mytab.mapstorage).graph.target(active_edge),N_COLOR); + propertyUpdate((mytab.mapstorage)->graph.target(active_edge),N_COLOR); target_item=NULL; } active_node=INVALID; @@ -521,7 +523,7 @@ active_node=INVALID; active_edge=INVALID; //was it a node? - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { if(nodesmap[i]==active_item) { @@ -531,7 +533,7 @@ //or was it an edge? if(active_node==INVALID) { - for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { if(edgesmap[i]->getLine()==active_item) { @@ -560,16 +562,16 @@ //a node was found if(active_node!=INVALID) { - (mytab.mapstorage).modified = true; + (mytab.mapstorage)->modified = true; std::set edges_to_delete; - for(OutEdgeIt e((mytab.mapstorage).graph,active_node);e!=INVALID;++e) + for(OutEdgeIt e((mytab.mapstorage)->graph,active_node);e!=INVALID;++e) { edges_to_delete.insert(e); } - for(InEdgeIt e((mytab.mapstorage).graph,active_node);e!=INVALID;++e) + for(InEdgeIt e((mytab.mapstorage)->graph,active_node);e!=INVALID;++e) { edges_to_delete.insert(e); } @@ -635,7 +637,7 @@ active_item=(get_item_at(clicked_x, clicked_y)); //find the activated item between text of nodes - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { //at the same time only one can be active if(nodetextmap[i]==active_item) @@ -647,7 +649,7 @@ //if there was not, search for it between nodes if(clicked_node==INVALID) { - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { //at the same time only one can be active if(nodesmap[i]==active_item) @@ -660,7 +662,7 @@ if(clicked_node==INVALID) { //find the activated item between texts - for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { //at the same time only one can be active if(edgetextmap[i]==active_item) @@ -672,7 +674,7 @@ //if it was not between texts, search for it between edges if(clicked_edge==INVALID) { - for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { //at the same time only one can be active if((edgesmap[i]->getLine())==active_item) @@ -714,7 +716,7 @@ break; case Gtk::RESPONSE_ACCEPT: double new_value = spin.get_value(); - (*(mytab.mapstorage).nodemap_storage[nodemap_to_edit])[active_node] = + (*(mytab.mapstorage)->nodemap_storage[nodemap_to_edit])[active_node] = new_value; std::ostringstream ostr; ostr << new_value; @@ -757,7 +759,7 @@ break; case Gtk::RESPONSE_ACCEPT: double new_value = spin.get_value(); - (*(mytab.mapstorage).edgemap_storage[edgemap_to_edit])[active_edge] = + (*(mytab.mapstorage)->edgemap_storage[edgemap_to_edit])[active_edge] = new_value; std::ostringstream ostr; ostr << new_value; @@ -782,14 +784,14 @@ { delete(nodetextmap[node_to_delete]); delete(nodesmap[node_to_delete]); - (mytab.mapstorage).graph.erase(node_to_delete); + (mytab.mapstorage)->graph.erase(node_to_delete); } void GraphDisplayerCanvas::deleteItem(Edge edge_to_delete) { delete(edgetextmap[edge_to_delete]); delete(edgesmap[edge_to_delete]); - (mytab.mapstorage).graph.erase(edge_to_delete); + (mytab.mapstorage)->graph.erase(edge_to_delete); } void GraphDisplayerCanvas::textReposition(XY new_place) @@ -809,7 +811,7 @@ } else { - for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { if(edgesmap[i]==active_bre) { @@ -851,62 +853,62 @@ nodetextmap[moved_node]->move(dx, dy); // the new coordinates of the centre of the node - double coord_x = dx + (mytab.mapstorage).coords[moved_node].x; - double coord_y = dy + (mytab.mapstorage).coords[moved_node].y; + double coord_x = dx + (mytab.mapstorage)->coords[moved_node].x; + double coord_y = dy + (mytab.mapstorage)->coords[moved_node].y; // write back the new coordinates to the coords map - (mytab.mapstorage).coords.set(moved_node, XY(coord_x, coord_y)); + (mytab.mapstorage)->coords.set(moved_node, XY(coord_x, coord_y)); //all the edges connected to the moved point has to be redrawn - for(OutEdgeIt ei((mytab.mapstorage).graph,moved_node);ei!=INVALID;++ei) + for(OutEdgeIt ei((mytab.mapstorage)->graph,moved_node);ei!=INVALID;++ei) { XY arrow_pos; - if (mytab.mapstorage.graph.source(ei) == mytab.mapstorage.graph.target(ei)) + if (mytab.mapstorage->graph.source(ei) == mytab.mapstorage->graph.target(ei)) { - arrow_pos = mytab.mapstorage.arrow_pos[ei] + XY(dx, dy); + arrow_pos = mytab.mapstorage->arrow_pos[ei] + XY(dx, dy); } else { XY moved_node_1(coord_x - dx, coord_y - dy); XY moved_node_2(coord_x, coord_y); - Node target = mytab.mapstorage.graph.target(ei); - XY fix_node(mytab.mapstorage.coords[target].x, - mytab.mapstorage.coords[target].y); - XY old_arrow_pos(mytab.mapstorage.arrow_pos[ei]); + Node target = mytab.mapstorage->graph.target(ei); + XY fix_node(mytab.mapstorage->coords[target].x, + mytab.mapstorage->coords[target].y); + XY old_arrow_pos(mytab.mapstorage->arrow_pos[ei]); arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, isbutton); } - mytab.mapstorage.arrow_pos.set(ei, arrow_pos); + mytab.mapstorage->arrow_pos.set(ei, arrow_pos); edgesmap[ei]->draw(); //reposition of edgetext - XY text_pos=mytab.mapstorage.arrow_pos[ei]; + XY text_pos=mytab.mapstorage->arrow_pos[ei]; text_pos+=(XY(10,10)); edgetextmap[ei]->property_x().set_value(text_pos.x); edgetextmap[ei]->property_y().set_value(text_pos.y); } - for(InEdgeIt ei((mytab.mapstorage).graph,moved_node);ei!=INVALID;++ei) + for(InEdgeIt ei((mytab.mapstorage)->graph,moved_node);ei!=INVALID;++ei) { - if (mytab.mapstorage.graph.source(ei) != mytab.mapstorage.graph.target(ei)) + if (mytab.mapstorage->graph.source(ei) != mytab.mapstorage->graph.target(ei)) { XY moved_node_1(coord_x - dx, coord_y - dy); XY moved_node_2(coord_x, coord_y); - Node source = mytab.mapstorage.graph.source(ei); - XY fix_node(mytab.mapstorage.coords[source].x, - mytab.mapstorage.coords[source].y); - XY old_arrow_pos(mytab.mapstorage.arrow_pos[ei]); + Node source = mytab.mapstorage->graph.source(ei); + XY fix_node(mytab.mapstorage->coords[source].x, + mytab.mapstorage->coords[source].y); + XY old_arrow_pos(mytab.mapstorage->arrow_pos[ei]); XY arrow_pos; arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, isbutton); - mytab.mapstorage.arrow_pos.set(ei, arrow_pos); + mytab.mapstorage->arrow_pos.set(ei, arrow_pos); edgesmap[ei]->draw(); //reposition of edgetext - XY text_pos=mytab.mapstorage.arrow_pos[ei]; + XY text_pos=mytab.mapstorage->arrow_pos[ei]; text_pos+=(XY(10,10)); edgetextmap[ei]->property_x().set_value(text_pos.x); edgetextmap[ei]->property_y().set_value(text_pos.y); diff -r 2a9a5d7f1a16 -r 6b2b718420eb graph_displayer_canvas-node.cc --- a/graph_displayer_canvas-node.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/graph_displayer_canvas-node.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,7 +16,9 @@ * */ -#include "graph_displayer_canvas.h" +#include +#include +#include #include const int minimum_node_radius=5; @@ -25,13 +27,13 @@ { Graph::NodeMap * actual_map; double min, max; - min=(mytab.mapstorage).minOfNodeMap(mapname); - max=(mytab.mapstorage).maxOfNodeMap(mapname); - actual_map=((mytab.mapstorage).nodemap_storage)[mapname]; + min=(mytab.mapstorage)->minOfNodeMap(mapname); + max=(mytab.mapstorage)->maxOfNodeMap(mapname); + actual_map=((mytab.mapstorage)->nodemap_storage)[mapname]; if(node==INVALID) { - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { double v=fabs((*actual_map)[i]); int w; @@ -103,11 +105,11 @@ double min, max; min=node_property_defaults[N_RADIUS]; max=node_property_defaults[N_RADIUS]; - Graph::NodeMap actual_map((mytab.mapstorage).graph,node_property_defaults[N_RADIUS]); + Graph::NodeMap actual_map((mytab.mapstorage)->graph,node_property_defaults[N_RADIUS]); if(node==INVALID) { - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { double v=fabs(actual_map[i]); int w; @@ -167,17 +169,17 @@ //green in RGB Graph::NodeMap * actual_map; - actual_map=((mytab.mapstorage).nodemap_storage)[mapname]; + actual_map=((mytab.mapstorage)->nodemap_storage)[mapname]; double max, min; - max=(mytab.mapstorage).maxOfNodeMap(mapname); - min=(mytab.mapstorage).minOfNodeMap(mapname); + max=(mytab.mapstorage)->maxOfNodeMap(mapname); + min=(mytab.mapstorage)->minOfNodeMap(mapname); if(node==INVALID) { - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { Gdk::Color color; @@ -222,7 +224,7 @@ //the minimum of the nodemap to the range of //green in RGB - Graph::NodeMap actual_map((mytab.mapstorage).graph,node_property_defaults[N_COLOR]); + Graph::NodeMap actual_map((mytab.mapstorage)->graph,node_property_defaults[N_COLOR]); double max, min; @@ -232,7 +234,7 @@ if(node==INVALID) { - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { Gdk::Color color; @@ -279,11 +281,11 @@ //that is the deleter map Graph::NodeMap * actual_map=NULL; - actual_map=((mytab.mapstorage).nodemap_storage)[mapname]; + actual_map=((mytab.mapstorage)->nodemap_storage)[mapname]; if(node==INVALID) { - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { nodemap_to_edit=mapname; double number=(*actual_map)[i]; @@ -316,7 +318,7 @@ if(node==INVALID) { - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { nodemap_to_edit=""; nodetextmap[i]->property_text().set_value(""); diff -r 2a9a5d7f1a16 -r 6b2b718420eb graph_displayer_canvas-zoom.cc --- a/graph_displayer_canvas-zoom.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/graph_displayer_canvas-zoom.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,7 +16,7 @@ * */ -#include "graph_displayer_canvas.h" +#include #include void GraphDisplayerCanvas::zoomIn() diff -r 2a9a5d7f1a16 -r 6b2b718420eb graph_displayer_canvas.cc --- a/graph_displayer_canvas.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/graph_displayer_canvas.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,13 +16,15 @@ * */ -#include "graph_displayer_canvas.h" +#include +#include +#include #include #include GraphDisplayerCanvas::GraphDisplayerCanvas(NoteBookTab & mainw) : - nodesmap(mainw.mapstorage.graph), edgesmap(mainw.mapstorage.graph), edgetextmap(mainw.mapstorage.graph), - nodetextmap(mainw.mapstorage.graph), displayed_graph(*(root()), 0, 0), + nodesmap(mainw.mapstorage->graph), edgesmap(mainw.mapstorage->graph), edgetextmap(mainw.mapstorage->graph), + nodetextmap(mainw.mapstorage->graph), displayed_graph(*(root()), 0, 0), isbutton(0), active_item(NULL), target_item(NULL), nodemap_to_edit(""), edgemap_to_edit(""), autoscale(true), zoomtrack(false), radius_size(20), edge_width(10), was_redesigned(false), is_drawn(false), mytab(mainw), @@ -49,11 +51,11 @@ { delete background; } - if (mytab.mapstorage.isBackgroundSet()) + if (mytab.mapstorage->isBackgroundSet()) { background_set = true; refBackground = Gdk::Pixbuf::create_from_file( - mytab.mapstorage.getBackgroundFilename()); + mytab.mapstorage->getBackgroundFilename()); background = new Gnome::Canvas::Pixbuf( *(root()), 0.0 - refBackground->get_width() / 2.0, @@ -69,13 +71,13 @@ GraphDisplayerCanvas::~GraphDisplayerCanvas() { - for (NodeIt n((mytab.mapstorage).graph); n != INVALID; ++n) + for (NodeIt n((mytab.mapstorage)->graph); n != INVALID; ++n) { delete nodesmap[n]; delete nodetextmap[n]; } - for (EdgeIt e((mytab.mapstorage).graph); e != INVALID; ++e) + for (EdgeIt e((mytab.mapstorage)->graph); e != INVALID; ++e) { delete edgesmap[e]; delete edgetextmap[e]; @@ -118,7 +120,7 @@ { if(mapname!="") { - if( ( ((mytab.mapstorage).nodemap_storage).find(mapname) != ((mytab.mapstorage).nodemap_storage).end() ) ) + if( ( ((mytab.mapstorage)->nodemap_storage).find(mapname) != ((mytab.mapstorage)->nodemap_storage).end() ) ) { switch(prop) { @@ -165,7 +167,7 @@ { if(mapname!="") { - if( ( ((mytab.mapstorage).edgemap_storage).find(mapname) != ((mytab.mapstorage).edgemap_storage).end() ) ) + if( ( ((mytab.mapstorage)->edgemap_storage).find(mapname) != ((mytab.mapstorage)->edgemap_storage).end() ) ) { switch(prop) { @@ -207,9 +209,9 @@ { //first edges are drawn, to hide joining with nodes later - for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (EdgeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { - if (mytab.mapstorage.graph.source(i) == mytab.mapstorage.graph.target(i)) + if (mytab.mapstorage->graph.source(i) == mytab.mapstorage->graph.target(i)) { edgesmap[i]=new LoopEdge(displayed_graph, i, *this); } @@ -219,7 +221,7 @@ } //initializing edge-text as well, to empty string - XY text_pos=mytab.mapstorage.arrow_pos[i]; + XY text_pos=mytab.mapstorage->arrow_pos[i]; text_pos+=(XY(10,10)); edgetextmap[i]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, ""); @@ -230,16 +232,16 @@ //afterwards nodes come to be drawn - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { //drawing bule nodes, with black line around them nodesmap[i]=new Gnome::Canvas::Ellipse( displayed_graph, - (mytab.mapstorage).coords[i].x-20, - (mytab.mapstorage).coords[i].y-20, - (mytab.mapstorage).coords[i].x+20, - (mytab.mapstorage).coords[i].y+20); + (mytab.mapstorage)->coords[i].x-20, + (mytab.mapstorage)->coords[i].y-20, + (mytab.mapstorage)->coords[i].x+20, + (mytab.mapstorage)->coords[i].y+20); *(nodesmap[i]) << Gnome::Canvas::Properties::fill_color("blue"); *(nodesmap[i]) << Gnome::Canvas::Properties::outline_color("black"); nodesmap[i]->raise_to_top(); @@ -247,8 +249,8 @@ //initializing edge-text as well, to empty string XY text_pos( - ((mytab.mapstorage).coords[i].x+node_property_defaults[N_RADIUS]+5), - ((mytab.mapstorage).coords[i].y+node_property_defaults[N_RADIUS]+5)); + ((mytab.mapstorage)->coords[i].x+node_property_defaults[N_RADIUS]+5), + ((mytab.mapstorage)->coords[i].y+node_property_defaults[N_RADIUS]+5)); nodetextmap[i]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, ""); @@ -281,13 +283,13 @@ active_edge=INVALID; forming_edge=INVALID; - for (NodeIt n((mytab.mapstorage).graph); n != INVALID; ++n) + for (NodeIt n((mytab.mapstorage)->graph); n != INVALID; ++n) { delete nodesmap[n]; delete nodetextmap[n]; } - for (EdgeIt e((mytab.mapstorage).graph); e != INVALID; ++e) + for (EdgeIt e((mytab.mapstorage)->graph); e != INVALID; ++e) { delete edgesmap[e]; delete edgetextmap[e]; @@ -323,7 +325,7 @@ void GraphDisplayerCanvas::reDesignGraph() { - NodeIt firstnode((mytab.mapstorage).graph); + NodeIt firstnode((mytab.mapstorage)->graph); //is it not an empty graph? if(firstnode!=INVALID) { @@ -333,7 +335,7 @@ if(!was_redesigned) { - NodeIt i((mytab.mapstorage).graph); + NodeIt i((mytab.mapstorage)->graph); dim2::Point init(init_vector_length*rnd(), init_vector_length*rnd()); @@ -345,28 +347,28 @@ double propulsation; int iterations; - (mytab.mapstorage).get_design_data(attraction, propulsation, iterations); + (mytab.mapstorage)->get_design_data(attraction, propulsation, iterations); //iteration counter for(int l=0;l x(mytab.mapstorage.graph); - Graph::NodeMap y(mytab.mapstorage.graph); + Graph::NodeMap x(mytab.mapstorage->graph); + Graph::NodeMap y(mytab.mapstorage->graph); XYMap > actual_forces; actual_forces.setXMap(x); actual_forces.setYMap(y); //count actual force for each nodes - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { //propulsation of nodes - for (NodeIt j((mytab.mapstorage).graph); j!=INVALID; ++j) + for (NodeIt j((mytab.mapstorage)->graph); j!=INVALID; ++j) { if(i!=j) { lemon::dim2::Point delta = - ((mytab.mapstorage).coords[i]- - (mytab.mapstorage).coords[j]); + ((mytab.mapstorage)->coords[i]- + (mytab.mapstorage)->coords[j]); const double length_sqr=std::max(delta.normSquare(),min_dist); @@ -381,11 +383,11 @@ } } //attraction of nodes, to which actual node is bound - for(OutEdgeIt ei((mytab.mapstorage).graph,i);ei!=INVALID;++ei) + for(OutEdgeIt ei((mytab.mapstorage)->graph,i);ei!=INVALID;++ei) { lemon::dim2::Point delta = - ((mytab.mapstorage).coords[i]- - (mytab.mapstorage).coords[mytab.mapstorage. + ((mytab.mapstorage)->coords[i]- + (mytab.mapstorage)->coords[mytab.mapstorage-> graph.target(ei)]); //calculating attraction strength @@ -394,11 +396,11 @@ actual_forces.set(i,actual_forces[i]-delta); } - for(InEdgeIt ei((mytab.mapstorage).graph,i);ei!=INVALID;++ei) + for(InEdgeIt ei((mytab.mapstorage)->graph,i);ei!=INVALID;++ei) { lemon::dim2::Point delta = - ((mytab.mapstorage).coords[i]- - (mytab.mapstorage).coords[mytab.mapstorage. + ((mytab.mapstorage)->coords[i]- + (mytab.mapstorage)->coords[mytab.mapstorage-> graph.source(ei)]); //calculating attraction strength @@ -408,27 +410,27 @@ actual_forces.set(i,actual_forces[i]-delta); } } - for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) + for (NodeIt i((mytab.mapstorage)->graph); i!=INVALID; ++i) { - if(((mytab.mapstorage).coords[i].x)+actual_forces[i].x>max_coord) + if(((mytab.mapstorage)->coords[i].x)+actual_forces[i].x>max_coord) { - actual_forces[i].x=max_coord-((mytab.mapstorage).coords[i].x); - std::cout << "Correction! " << (((mytab.mapstorage).coords[i].x)+actual_forces[i].x) << std::endl; + actual_forces[i].x=max_coord-((mytab.mapstorage)->coords[i].x); + std::cout << "Correction! " << (((mytab.mapstorage)->coords[i].x)+actual_forces[i].x) << std::endl; } - else if(((mytab.mapstorage).coords[i].x)+actual_forces[i].x<(0-max_coord)) + else if(((mytab.mapstorage)->coords[i].x)+actual_forces[i].x<(0-max_coord)) { - actual_forces[i].x=0-max_coord-((mytab.mapstorage).coords[i].x); - std::cout << "Correction! " << (((mytab.mapstorage).coords[i].x)+actual_forces[i].x) << std::endl; + actual_forces[i].x=0-max_coord-((mytab.mapstorage)->coords[i].x); + std::cout << "Correction! " << (((mytab.mapstorage)->coords[i].x)+actual_forces[i].x) << std::endl; } - if(((mytab.mapstorage).coords[i].y)+actual_forces[i].y>max_coord) + if(((mytab.mapstorage)->coords[i].y)+actual_forces[i].y>max_coord) { - actual_forces[i].y=max_coord-((mytab.mapstorage).coords[i].y); - std::cout << "Correction! " << (((mytab.mapstorage).coords[i].y)+actual_forces[i].y) << std::endl; + actual_forces[i].y=max_coord-((mytab.mapstorage)->coords[i].y); + std::cout << "Correction! " << (((mytab.mapstorage)->coords[i].y)+actual_forces[i].y) << std::endl; } - else if(((mytab.mapstorage).coords[i].y)+actual_forces[i].y<(0-max_coord)) + else if(((mytab.mapstorage)->coords[i].y)+actual_forces[i].y<(0-max_coord)) { - actual_forces[i].y=0-max_coord-((mytab.mapstorage).coords[i].y); - std::cout << "Correction! " << (((mytab.mapstorage).coords[i].y)+actual_forces[i].y) << std::endl; + actual_forces[i].y=0-max_coord-((mytab.mapstorage)->coords[i].y); + std::cout << "Correction! " << (((mytab.mapstorage)->coords[i].y)+actual_forces[i].y) << std::endl; } moveNode(actual_forces[i].x, actual_forces[i].y, nodesmap[i], i); } diff -r 2a9a5d7f1a16 -r 6b2b718420eb graph_displayer_canvas.h --- a/graph_displayer_canvas.h Wed Feb 28 15:19:20 2007 +0000 +++ b/graph_displayer_canvas.h Wed Feb 28 18:20:28 2007 +0000 @@ -19,13 +19,11 @@ #ifndef GRAPH_DISPLAYER_CANVAS_H #define GRAPH_DISPLAYER_CANVAS_H -class GraphDisplayerCanvas; +class NoteBookTab; #include "all_include.h" -#include "nbtab.h" #include #include -#include ///This class is the canvas, on which the graph can be drawn. class GraphDisplayerCanvas : public Gnome::Canvas::CanvasAA diff -r 2a9a5d7f1a16 -r 6b2b718420eb gui_reader.cc --- a/gui_reader.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/gui_reader.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,9 +16,10 @@ * */ -#include "gui_reader.h" -#include "xml.h" -#include "mapstorage.h" +#include +#include + +#include #include #include diff -r 2a9a5d7f1a16 -r 6b2b718420eb gui_reader.h --- a/gui_reader.h Wed Feb 28 15:19:20 2007 +0000 +++ b/gui_reader.h Wed Feb 28 18:20:28 2007 +0000 @@ -18,9 +18,9 @@ #ifndef GUI_READER_H #define GUI_READER_H +#include -#include "mapstorage.h" -#include +class MapStorage; using lemon::LemonReader; diff -r 2a9a5d7f1a16 -r 6b2b718420eb gui_writer.cc --- a/gui_writer.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/gui_writer.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,12 +16,13 @@ * */ -#include "gui_writer.h" -#include "xml.h" -#include "mapstorage.h" +#include #include #include +#include +#include + std::string GuiWriter::header() { return "@gui"; diff -r 2a9a5d7f1a16 -r 6b2b718420eb gui_writer.h --- a/gui_writer.h Wed Feb 28 15:19:20 2007 +0000 +++ b/gui_writer.h Wed Feb 28 18:20:28 2007 +0000 @@ -19,9 +19,10 @@ #ifndef GUI_WRITER_H #define GUI_WRITER_H -#include "mapstorage.h" #include +class MapStorage; + using lemon::LemonWriter; class GuiWriter : public LemonWriter::SectionWriter diff -r 2a9a5d7f1a16 -r 6b2b718420eb kruskalbox.cc --- a/kruskalbox.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/kruskalbox.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,6 +16,11 @@ * */ +#include + +#include +#include +#include #include enum {INPUT, OUTPUT, MAP_NUM}; diff -r 2a9a5d7f1a16 -r 6b2b718420eb kruskalbox.h --- a/kruskalbox.h Wed Feb 28 15:19:20 2007 +0000 +++ b/kruskalbox.h Wed Feb 28 18:20:28 2007 +0000 @@ -19,11 +19,9 @@ #ifndef KRUSKALBOX_H #define KRUSKALBOX_H -class KruskalBox; +class AlgoBox; #include -#include -#include #include #include diff -r 2a9a5d7f1a16 -r 6b2b718420eb main_win.cc --- a/main_win.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/main_win.cc Wed Feb 28 18:20:28 2007 +0000 @@ -20,9 +20,15 @@ #include #endif -#include "main_win.h" -#include "guipixbufs.h" -#include "background_chooser_dialog.h" +#include +#include +#include + +#include +#include +#include +#include +#include #include "i18n.h" @@ -364,7 +370,7 @@ { if(active_tab!=-1) { - if (tabs[active_tab]->mapstorage.modified) + if (tabs[active_tab]->mapstorage->modified) { Gtk::MessageDialog mdialog(_("Save changes before closing?"), true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE); @@ -553,7 +559,7 @@ for(;(i<(int)tabnames.size())&&(tabnames[i]!=tabname);i++) { } - awp->update_maplist(&(tabs[i]->mapstorage)); + awp->update_maplist(tabs[i]->mapstorage); } void MainWin::deRegisterAlgoWin(AlgoWin * awp) @@ -632,6 +638,6 @@ void MainWin::createBackgroundChooser() { - BackgroundChooserDialog dialog(&(tabs[active_tab]->mapstorage)); + BackgroundChooserDialog dialog(tabs[active_tab]->mapstorage); dialog.run(); } diff -r 2a9a5d7f1a16 -r 6b2b718420eb main_win.h --- a/main_win.h Wed Feb 28 15:19:20 2007 +0000 +++ b/main_win.h Wed Feb 28 18:20:28 2007 +0000 @@ -20,13 +20,11 @@ #define MAIN_WIN_H #include "all_include.h" -#include "algowin.h" -#include "map_win.h" -#include "new_map_win.h" -#include "nbtab.h" #include #include +class AlgoWin; +class NoteBookTab; ///This class is the main window of GUI. diff -r 2a9a5d7f1a16 -r 6b2b718420eb map_win.cc --- a/map_win.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/map_win.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,7 +16,9 @@ * */ -#include "map_win.h" +#include +#include +#include #include bool MapWin::closeIfEscapeIsPressed(GdkEventKey* e) diff -r 2a9a5d7f1a16 -r 6b2b718420eb map_win.h --- a/map_win.h Wed Feb 28 15:19:20 2007 +0000 +++ b/map_win.h Wed Feb 28 18:20:28 2007 +0000 @@ -19,11 +19,10 @@ #ifndef MAP_WIN_H #define MAP_WIN_H -class MapWin; +class NoteBookTab; +class MapSelector; #include -#include -#include #include #include diff -r 2a9a5d7f1a16 -r 6b2b718420eb mapselector.cc --- a/mapselector.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/mapselector.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,7 +16,7 @@ * */ -#include "mapselector.h" +#include MapSelector::MapSelector(std::vector ml, std::string act, std::string labeltext, bool edge, bool d):def(d),itisedge(edge),set_new_map(false) { diff -r 2a9a5d7f1a16 -r 6b2b718420eb mapselector.h --- a/mapselector.h Wed Feb 28 15:19:20 2007 +0000 +++ b/mapselector.h Wed Feb 28 18:20:28 2007 +0000 @@ -19,10 +19,7 @@ #ifndef MAPSELECTOR_H #define MAPSELECTOR_H -class MapSelector; - #include -#include #include #include diff -r 2a9a5d7f1a16 -r 6b2b718420eb mapstorage.cc --- a/mapstorage.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/mapstorage.cc Wed Feb 28 18:20:28 2007 +0000 @@ -16,14 +16,16 @@ * */ -#include "mapstorage.h" -#include "nbtab.h" -#include "gui_writer.h" -#include "gui_reader.h" #include #include #include -#include + +#include +#include //kivenni +#include //kivenni +#include +#include +#include const int i_d=20; const double a_d=0.05; diff -r 2a9a5d7f1a16 -r 6b2b718420eb mapstorage.h --- a/mapstorage.h Wed Feb 28 15:19:20 2007 +0000 +++ b/mapstorage.h Wed Feb 28 18:20:28 2007 +0000 @@ -19,10 +19,8 @@ #ifndef MAPSTORAGE_H #define MAPSTORAGE_H -class Mapstorage; - -#include "all_include.h" -#include "xymap.h" +#include +#include #include class NoteBookTab; diff -r 2a9a5d7f1a16 -r 6b2b718420eb nbtab.cc --- a/nbtab.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/nbtab.cc Wed Feb 28 18:20:28 2007 +0000 @@ -17,39 +17,47 @@ */ #include +#include #include +#include +#include +#include -NoteBookTab::NoteBookTab():mapwinexists(false), designwinexists(false), mapstorage(*this) + + +NoteBookTab::NoteBookTab():mapwinexists(false), designwinexists(false) { + mapstorage=new MapStorage(*this); + Gtk::ScrolledWindow *pScrolledWindow = manage(new Gtk::ScrolledWindow); gd_canvas=new GraphDisplayerCanvas(*this); pScrolledWindow->add(*gd_canvas); add(*pScrolledWindow); //connecting signals - controller character - mapstorage.signal_prop_ch().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::propertyChange)); - mapstorage.signal_node_map_ch().connect(sigc::mem_fun(*this, &NoteBookTab::registerNewNodeMap)); - mapstorage.signal_edge_map_ch().connect(sigc::mem_fun(*this, &NoteBookTab::registerNewEdgeMap)); + mapstorage->signal_prop_ch().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::propertyChange)); + mapstorage->signal_node_map_ch().connect(sigc::mem_fun(*this, &NoteBookTab::registerNewNodeMap)); + mapstorage->signal_edge_map_ch().connect(sigc::mem_fun(*this, &NoteBookTab::registerNewEdgeMap)); show_all_children(); show(); } void NoteBookTab::readFile(const std::string &file) { - mapstorage.readFromFile(file); - mapstorage.file_name = file; - mapstorage.modified = false; + mapstorage->readFromFile(file); + mapstorage->file_name = file; + mapstorage->modified = false; gd_canvas->drawGraph(); if(mapwinexists) { - mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList()); + mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList()); } signal_title.emit(Glib::filename_display_basename(file)); } void NoteBookTab::newFile() { - if (mapstorage.modified) + if (mapstorage->modified) { Gtk::MessageDialog mdialog("Save changes before closing?", true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE); @@ -68,17 +76,17 @@ } } gd_canvas->clear(); - mapstorage.clear(); + mapstorage->clear(); if(mapwinexists) { - mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList()); + mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList()); } signal_title.emit("unsaved file"); } void NoteBookTab::openFile() { - if (mapstorage.modified) + if (mapstorage->modified) { Gtk::MessageDialog mdialog("Save changes before closing?", true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE); @@ -102,16 +110,16 @@ if (fcdialog.run() == Gtk::RESPONSE_ACCEPT) { gd_canvas->clear(); - mapstorage.clear(); + mapstorage->clear(); Glib::ustring filename = fcdialog.get_filename(); - if (!mapstorage.readFromFile(filename)) + if (!mapstorage->readFromFile(filename)) { - mapstorage.file_name = filename; - mapstorage.modified = false; + mapstorage->file_name = filename; + mapstorage->modified = false; gd_canvas->drawGraph(); if(mapwinexists) { - mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList()); + mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList()); } signal_title.emit(Glib::filename_display_basename(filename)); } @@ -120,14 +128,14 @@ void NoteBookTab::saveFile() { - if (mapstorage.file_name == "") { + if (mapstorage->file_name == "") { saveFileAs(); } else { - mapstorage.writeToFile(mapstorage.file_name); - mapstorage.modified = false; - signal_title.emit(Glib::filename_display_basename(mapstorage.file_name)); + mapstorage->writeToFile(mapstorage->file_name); + mapstorage->modified = false; + signal_title.emit(Glib::filename_display_basename(mapstorage->file_name)); } } @@ -139,16 +147,16 @@ if (fcdialog.run() == Gtk::RESPONSE_ACCEPT) { Glib::ustring filename = fcdialog.get_filename(); - mapstorage.file_name = filename; - mapstorage.writeToFile(filename); - mapstorage.modified = false; + mapstorage->file_name = filename; + mapstorage->writeToFile(filename); + mapstorage->modified = false; signal_title.emit(Glib::filename_display_basename(filename)); } } void NoteBookTab::close() { - if (mapstorage.modified) + if (mapstorage->modified) { Gtk::MessageDialog mdialog("Save changes before closing?", true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE); @@ -167,17 +175,17 @@ } } gd_canvas->clear(); - mapstorage.clear(); + mapstorage->clear(); if(mapwinexists) { - mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList()); + mapwin->update(mapstorage->getEdgeMapList(), mapstorage->getNodeMapList()); } signal_title.emit("unsaved file"); } void NoteBookTab::propertyChange(bool itisedge, int prop, std::string mapname) { - mapstorage.changeActiveMap(itisedge, prop, mapname); + mapstorage->changeActiveMap(itisedge, prop, mapname); } sigc::signal NoteBookTab::signal_newmap_needed() @@ -192,12 +200,12 @@ std::string NoteBookTab::getActiveEdgeMap(int prop) { - return mapstorage.getActiveEdgeMap(prop); + return mapstorage->getActiveEdgeMap(prop); } std::string NoteBookTab::getActiveNodeMap(int prop) { - return mapstorage.getActiveNodeMap(prop); + return mapstorage->getActiveNodeMap(prop); } void NoteBookTab::registerNewEdgeMap(std::string mapname) @@ -220,8 +228,8 @@ { if(!mapwinexists) { - mapwin=new MapWin("Map Setup - "+name, mapstorage.getEdgeMapList(), mapstorage.getNodeMapList(), *this); - mapst2mapwin=mapstorage.signal_map_win_ch().connect(sigc::mem_fun(*mapwin, &MapWin::changeEntry)); + mapwin=new MapWin("Map Setup - "+name, mapstorage->getEdgeMapList(), mapstorage->getNodeMapList(), *this); + mapst2mapwin=mapstorage->signal_map_win_ch().connect(sigc::mem_fun(*mapwin, &MapWin::changeEntry)); mapwin->show(); mapwinexists=true; } @@ -244,7 +252,7 @@ { double attraction, propulsation; int iterations; - mapstorage.get_design_data(attraction, propulsation, iterations); + mapstorage->get_design_data(attraction, propulsation, iterations); designwin=new DesignWin("Design Setup - "+name, attraction, propulsation, iterations, *this); designwin->signal_attraction().connect(sigc::mem_fun(mapstorage, &MapStorage::set_attraction)); @@ -254,7 +262,7 @@ designwin->signal_delete_event().connect(sigc::mem_fun(*this, &NoteBookTab::closeDesignWin)); - mapst2designwin=mapstorage.signal_design_win_ch().connect(sigc::mem_fun(*designwin, &DesignWin::set_data)); + mapst2designwin=mapstorage->signal_design_win_ch().connect(sigc::mem_fun(*designwin, &DesignWin::set_data)); designwin->show(); designwinexists=true; @@ -306,10 +314,10 @@ void NoteBookTab::active_maps_needed() { - mapstorage.broadcastActiveMaps(); + mapstorage->broadcastActiveMaps(); } void NoteBookTab::exportGraphToEPS(std::vector options, std::string filename) { - mapstorage.exportGraphToEPS(options, filename); + mapstorage->exportGraphToEPS(options, filename); } diff -r 2a9a5d7f1a16 -r 6b2b718420eb nbtab.h --- a/nbtab.h Wed Feb 28 15:19:20 2007 +0000 +++ b/nbtab.h Wed Feb 28 18:20:28 2007 +0000 @@ -19,14 +19,12 @@ #ifndef NBTAB_H #define NBTAB_H -class NoteBookTab; +class MapStorage; +class EpsWin; +class MapWin; +class DesignWin; +class GraphDisplayerCanvas; -#include "mapstorage.h" -#include "map_win.h" -//#include "eps_win.h" -class EpsWin; -#include "design_win.h" -#include "graph_displayer_canvas.h" #include #include @@ -59,7 +57,7 @@ NoteBookTab(); ///Maps assigned to the graph displayed in this \ref NoteBookTab of notebook. - MapStorage mapstorage; + MapStorage * mapstorage; ///Title changement indicator. diff -r 2a9a5d7f1a16 -r 6b2b718420eb new_map_win.cc --- a/new_map_win.cc Wed Feb 28 15:19:20 2007 +0000 +++ b/new_map_win.cc Wed Feb 28 18:20:28 2007 +0000 @@ -17,6 +17,8 @@ */ #include +#include +#include bool NewMapWin::closeIfEscapeIsPressed(GdkEventKey* e) { @@ -119,13 +121,13 @@ if(edge.get_active()) { //create the new map - Graph::EdgeMap * emptr=new Graph::EdgeMap (mytab.mapstorage.graph, def_val); + Graph::EdgeMap * emptr=new Graph::EdgeMap (mytab.mapstorage->graph, def_val); if(!only_nums) { std::stack polishstack; - for(EdgeIt k(mytab.mapstorage.graph); k!=INVALID; ++k) + for(EdgeIt k(mytab.mapstorage->graph); k!=INVALID; ++k) { for(int i=0;i<(int)polishform.size();i++) { @@ -144,11 +146,11 @@ break; default: //substitute variable - std::map< std::string,Graph::EdgeMap * > ems=mytab.mapstorage.edgemap_storage; + std::map< std::string,Graph::EdgeMap * > ems=mytab.mapstorage->edgemap_storage; bool itisvar=(ems.find(ch2var[ polishform[i] ])!=ems.end()); if(itisvar) { - polishstack.push( (*(mytab.mapstorage.edgemap_storage[ ch2var[ polishform[i] ] ]))[k]); + polishstack.push( (*(mytab.mapstorage->edgemap_storage[ ch2var[ polishform[i] ] ]))[k]); } else { @@ -187,7 +189,7 @@ //if addition was not successful addEdgeMap returns one. //cause can be that there is already a map named like the new one - if(mytab.mapstorage.addEdgeMap(mapname, emptr, def_val)) + if(mytab.mapstorage->addEdgeMap(mapname, emptr, def_val)) { abortion=1; } @@ -202,13 +204,13 @@ else //!edge.get_active() { //create the new map - Graph::NodeMap * emptr=new Graph::NodeMap (mytab.mapstorage.graph, def_val); + Graph::NodeMap * emptr=new Graph::NodeMap (mytab.mapstorage->graph, def_val); if(!only_nums) { std::stack polishstack; - for(NodeIt k(mytab.mapstorage.graph); k!=INVALID; ++k) + for(NodeIt k(mytab.mapstorage->graph); k!=INVALID; ++k) { for(int i=0;i<(int)polishform.size();i++) { @@ -226,11 +228,11 @@ polishstack.pop(); break; default: - std::map< std::string,Graph::NodeMap * > nms=mytab.mapstorage.nodemap_storage; + std::map< std::string,Graph::NodeMap * > nms=mytab.mapstorage->nodemap_storage; bool itisvar=(nms.find(ch2var[ polishform[i] ])!=nms.end()); if(itisvar) { - polishstack.push( (*(mytab.mapstorage.nodemap_storage[ ch2var[ polishform[i] ] ]))[k]); + polishstack.push( (*(mytab.mapstorage->nodemap_storage[ ch2var[ polishform[i] ] ]))[k]); } else { @@ -268,7 +270,7 @@ } //if addition was not successful addNodeMap returns one. //cause can be that there is already a map named like the new one - if(mytab.mapstorage.addNodeMap(mapname,emptr, def_val)) + if(mytab.mapstorage->addNodeMap(mapname,emptr, def_val)) { abortion=1; } @@ -479,11 +481,11 @@ //is it mapname? if(itisedge) { - cancel=(mytab.mapstorage.edgemap_storage.find(variable)==mytab.mapstorage.edgemap_storage.end()); + cancel=(mytab.mapstorage->edgemap_storage.find(variable)==mytab.mapstorage->edgemap_storage.end()); } else { - cancel=(mytab.mapstorage.nodemap_storage.find(variable)==mytab.mapstorage.nodemap_storage.end()); + cancel=(mytab.mapstorage->nodemap_storage.find(variable)==mytab.mapstorage->nodemap_storage.end()); } //maybe it is number int point_num=0; diff -r 2a9a5d7f1a16 -r 6b2b718420eb new_map_win.h --- a/new_map_win.h Wed Feb 28 15:19:20 2007 +0000 +++ b/new_map_win.h Wed Feb 28 18:20:28 2007 +0000 @@ -19,14 +19,13 @@ #ifndef NEWMAPWIN_H #define NEWMAPWIN_H -class NewMapWin; - #include -#include #include #include #include +class NoteBookTab; + ///Graphical interface for node/edge map creation. ///This class is responsible for creating a window,