# HG changeset patch # User ladanyi # Date 1134852941 0 # Node ID 27a9a75b957b81296aaa84b1929b3983c53860dc # Parent 075aaa0a4e6f5b777d926c0cd956825cf316e538 Save and load the coordinates of the arrows on the edges. diff -r 075aaa0a4e6f -r 27a9a75b957b gui/Makefile.am --- a/gui/Makefile.am Wed Dec 14 18:11:03 2005 +0000 +++ b/gui/Makefile.am Sat Dec 17 20:55:41 2005 +0000 @@ -28,6 +28,10 @@ new_map_win.cc \ new_map_win.h \ xymap.h \ + gui_reader.h \ + gui_reader.cc \ + gui_writer.h \ + gui_writer.cc \ icons/guipixbufs.h diff -r 075aaa0a4e6f -r 27a9a75b957b gui/all_include.h --- a/gui/all_include.h Wed Dec 14 18:11:03 2005 +0000 +++ b/gui/all_include.h Sat Dec 17 20:55:41 2005 +0000 @@ -37,9 +37,8 @@ using namespace lemon; -typedef xy Coordinates; +typedef xy XY; typedef ListGraph Graph; -typedef Graph::NodeMap CoordinatesMap; typedef Graph::Node Node; typedef Graph::Edge Edge; typedef Graph::EdgeIt EdgeIt; diff -r 075aaa0a4e6f -r 27a9a75b957b gui/gdc-broken_edge.cc --- a/gui/gdc-broken_edge.cc Wed Dec 14 18:11:03 2005 +0000 +++ b/gui/gdc-broken_edge.cc Sat Dec 17 20:55:41 2005 +0000 @@ -1,15 +1,13 @@ #include "graph_displayer_canvas.h" #include -GraphDisplayerCanvas::BrokenEdge::BrokenEdge(Gnome::Canvas::Group & g, Gnome::Canvas::Points p, GraphDisplayerCanvas & gc) : Line(g), gdc(gc), isbutton(false) +GraphDisplayerCanvas::BrokenEdge::BrokenEdge(Gnome::Canvas::Group & g, Edge _edge, GraphDisplayerCanvas & gc) : Line(g), edge(_edge), gdc(gc), isbutton(false) { - my_points=new Gnome::Art::Point[3]; - arrow=new Gnome::Canvas::Polygon(g); *arrow << Gnome::Canvas::Properties::fill_color("red"); arrow->signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::BrokenEdge::edgeFormerEventHandler)); arrow->lower_to_bottom(); - setPoints(p); + draw(); } GraphDisplayerCanvas::BrokenEdge::~BrokenEdge() @@ -17,155 +15,71 @@ if(arrow)delete(arrow); } -void GraphDisplayerCanvas::BrokenEdge::setPoints(Gnome::Canvas::Points p, bool move) +void GraphDisplayerCanvas::BrokenEdge::draw() { - bool set_arrow=false; - //red arrow losts its position-right button - if(!move) - { - if(p.size()==2) - { - set_arrow=true; - Gnome::Canvas::Points points_with_center; - points_with_center.push_back(my_points[0]=p[0]); - points_with_center.push_back(my_points[1]=Gnome::Art::Point( (p[0].get_x()+p[1].get_x())/2+0 , (p[0].get_y()+p[1].get_y())/2 )+0 ); - points_with_center.push_back(my_points[2]=p[1]); - property_points().set_value(points_with_center); - } - if(p.size()==3) - { - set_arrow=true; - property_points().set_value(p); - for(int i=0;i<3;i++) - { - my_points[i]=p[i]; - } - } + MapStorage& ms = gdc.mytab.mapstorage; + + // update the edge + { + Gnome::Canvas::Points points; + Node source = ms.graph.source(edge); + Node target = ms.graph.target(edge); + points.push_back(Gnome::Art::Point(ms.coords[source].x, + ms.coords[source].y)); + points.push_back(Gnome::Art::Point(ms.arrow_pos[edge].x, + ms.arrow_pos[edge].y)); + points.push_back(Gnome::Art::Point(ms.coords[target].x, + ms.coords[target].y)); + property_points().set_value(points); + } + + // update the arrow + { + //calculating coordinates of the direction indicator arrow + XY target(ms.coords[ms.graph.target(edge)]); + XY center(ms.arrow_pos[edge]); + + XY unit_vector_in_dir(target-center); + double length=sqrt( unit_vector_in_dir.normSquare() ); + + // std::cout << target << " - " << center << " = " << unit_vector_in_dir << " / " < c_v(my_points[1].get_x()-my_points[0].get_x(),my_points[1].get_y()-my_points[0].get_y()); - - //unit vector with the same direction to a_v - xy a_v_u(a_v.x/absa,a_v.y/absa); - - //normal vector of unit vector with the same direction to a_v - xy a_v_u_n(((-1)*a_v_u.y),a_v_u.x); - - //unit vector with the same direction to b_v - xy b_v_u(b_v.x/absb,b_v.y/absb); - - //normal vector of unit vector with the same direction to b_v - xy b_v_u_n(((-1)*b_v_u.y),b_v_u.x); - - //vector c in a_v_u and a_v_u_n co-ordinate system - xy c_a(c_v*a_v_u,c_v*a_v_u_n); - - //new vector from one node to the breakpoint - d - we have to calculate this one - xy d_v=absb/absa*(c_a.x*b_v_u+c_a.y*b_v_u_n); - - my_points[1]=Gnome::Art::Point(d_v.x+p[0].get_x(),d_v.y+p[0].get_y()); - - my_points[0]=p[0]; - my_points[2]=p[1]; - - Gnome::Canvas::Points points; - for(int i=0;i<3;i++) - { - points.push_back(my_points[i]); - } - property_points().set_value(points); - } - else - { - //if distance is 0, segmentation would be occured - //in calculations, because of division by zero - //But we have luck: the edge cannot be seen in - //this case, so no update needed - set_arrow=false; - } - } - } - if(set_arrow) - { - //calculating coordinates of the direction indicator arrow - - xy target( my_points[2].get_x(), my_points[2].get_y() ); - xy center( my_points[1].get_x(), my_points[1].get_y() ); - - xy unit_vector_in_dir(target-center); - double length=sqrt( unit_vector_in_dir.normSquare() ); - - // std::cout << target << " - " << center << " = " << unit_vector_in_dir << " / " <property_points().set_value(arrow_points); - } + arrow->property_points().set_value(arrow_points); + } } bool GraphDisplayerCanvas::BrokenEdge::edgeFormerEventHandler(GdkEvent* e) @@ -203,12 +117,10 @@ Gnome::Canvas::Points points_new; - points_new.push_back(my_points[0]); - points_new.push_back(my_points[1]=Gnome::Art::Point(my_points[1].get_x()+dx,my_points[1].get_y()+dy)); - points_new.push_back(my_points[2]); + gdc.mytab.mapstorage.arrow_pos.set(edge, gdc.mytab.mapstorage.arrow_pos[edge] + XY(dx, dy)); - setPoints(points_new); - gdc.textReposition(xy(my_points[1].get_x(),my_points[1].get_y())); + draw(); + gdc.textReposition(gdc.mytab.mapstorage.arrow_pos[edge]); clicked_x=e->motion.x; clicked_y=e->motion.y; @@ -219,9 +131,3 @@ return true; } - -xy GraphDisplayerCanvas::BrokenEdge::getArrowPos() -{ - xy ret_val(my_points[1].get_x(),my_points[1].get_y()); - return ret_val; -} diff -r 075aaa0a4e6f -r 27a9a75b957b gui/graph_displayer_canvas-event.cc --- a/gui/graph_displayer_canvas-event.cc Wed Dec 14 18:11:03 2005 +0000 +++ b/gui/graph_displayer_canvas-event.cc Sat Dec 17 20:55:41 2005 +0000 @@ -147,12 +147,12 @@ double coord_x = new_x - (clicked_x - (mytab.mapstorage).coords[active_node].x); double coord_y = new_y - (clicked_y - (mytab.mapstorage).coords[active_node].y); + // write back the new coordinates to the coords map + (mytab.mapstorage).coords.set(active_node, xy(coord_x, coord_y)); + clicked_x=new_x; clicked_y=new_y; - // write back the new coordinates to the coords map - (mytab.mapstorage).coords.set(active_node, xy(coord_x, coord_y)); - // reposition the coordinates text std::ostringstream ostr; ostr << "(" << @@ -183,53 +183,50 @@ //all the edges connected to the moved point has to be redrawn for(OutEdgeIt ei((mytab.mapstorage).graph,active_node);ei!=INVALID;++ei) { - Gnome::Canvas::Points coos; - double x1, x2, y1, y2; + 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]); - nodesmap[(mytab.mapstorage).graph.source(ei)]->get_bounds(x1, y1, x2, y2); - coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); + XY arrow_pos; + if(isbutton==3) + arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, false); + else + arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, true); - nodesmap[(mytab.mapstorage).graph.target(ei)]->get_bounds(x1, y1, x2, y2); - coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); - - if(isbutton==3) - { - edgesmap[ei]->setPoints(coos); - } - else - { - edgesmap[ei]->setPoints(coos,true); - } + mytab.mapstorage.arrow_pos.set(ei, arrow_pos); + edgesmap[ei]->draw(); //reposition of edgetext - xy text_pos=edgesmap[ei]->getArrowPos(); - text_pos+=(xy(10,10)); + 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,active_node);ei!=INVALID;++ei) { - Gnome::Canvas::Points coos; - double x1, x2, y1, y2; + 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]); - nodesmap[(mytab.mapstorage).graph.source(ei)]->get_bounds(x1, y1, x2, y2); - coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); + XY arrow_pos; + if(isbutton==3) + arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, false); + else + arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, true); - nodesmap[(mytab.mapstorage).graph.target(ei)]->get_bounds(x1, y1, x2, y2); - coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); + mytab.mapstorage.arrow_pos.set(ei, arrow_pos); + edgesmap[ei]->draw(); - if(isbutton==3) - { - edgesmap[ei]->setPoints(coos); - } - else - { - edgesmap[ei]->setPoints(coos,true); - } - - xy text_pos=edgesmap[ei]->getArrowPos(); - text_pos+=(xy(10,10)); + //reposition of edgetext + 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); } @@ -240,6 +237,58 @@ return false; } +XY GraphDisplayerCanvas::calcArrowPos(XY moved_node_1, XY moved_node_2, XY fix_node, XY old_arrow_pos, bool move) +{ + if(!move) + { + return XY((moved_node_2.x + fix_node.x) / 2.0, (moved_node_2.y + fix_node.y) / 2.0); + } + else + { + ////////////////////////////////////////////////////////////////////////////////////////////////////// + /////////// keeps shape-with scalar multiplication - version 2. + ////////////////////////////////////////////////////////////////////////////////////////////////////// + + //old vector from one to the other node - a + xy a_v(moved_node_1.x-fix_node.x,moved_node_1.y-fix_node.y); + //new vector from one to the other node - b + xy b_v(moved_node_2.x-fix_node.x,moved_node_2.y-fix_node.y); + + double absa=sqrt(a_v.normSquare()); + double absb=sqrt(b_v.normSquare()); + + if ((absa == 0.0) || (absb == 0.0)) + { + return old_arrow_pos; + } + else + { + //old vector from one node to the breakpoint - c + xy c_v(old_arrow_pos.x-fix_node.x,old_arrow_pos.y-fix_node.y); + + //unit vector with the same direction to a_v + xy a_v_u(a_v.x/absa,a_v.y/absa); + + //normal vector of unit vector with the same direction to a_v + xy a_v_u_n(((-1)*a_v_u.y),a_v_u.x); + + //unit vector with the same direction to b_v + xy b_v_u(b_v.x/absb,b_v.y/absb); + + //normal vector of unit vector with the same direction to b_v + xy b_v_u_n(((-1)*b_v_u.y),b_v_u.x); + + //vector c in a_v_u and a_v_u_n co-ordinate system + xy c_a(c_v*a_v_u,c_v*a_v_u_n); + + //new vector from one node to the breakpoint - d - we have to calculate this one + xy d_v=absb/absa*(c_a.x*b_v_u+c_a.y*b_v_u_n); + + return XY(d_v.x+fix_node.x,d_v.y+fix_node.y); + } + } +} + bool GraphDisplayerCanvas::createNodeEventHandler(GdkEvent* e) { switch(e->type) @@ -405,7 +454,7 @@ coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); //drawing new edge - edgesmap[active_edge]=new BrokenEdge(displayed_graph, coos, + edgesmap[active_edge]=new BrokenEdge(displayed_graph, active_edge, *this); *(edgesmap[active_edge]) << Gnome::Canvas::Properties::fill_color("green"); @@ -414,8 +463,8 @@ edgesmap[active_edge]->lower_to_bottom(); //initializing edge-text as well, to empty string - xy text_pos=edgesmap[active_edge]->getArrowPos(); - text_pos+=(xy(10,10)); + XY text_pos=mytab.mapstorage.arrow_pos[active_edge]; + text_pos+=(XY(10,10)); edgetextmap[active_edge]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, ""); diff -r 075aaa0a4e6f -r 27a9a75b957b gui/graph_displayer_canvas.cc --- a/gui/graph_displayer_canvas.cc Wed Dec 14 18:11:03 2005 +0000 +++ b/gui/graph_displayer_canvas.cc Sat Dec 17 20:55:41 2005 +0000 @@ -168,15 +168,15 @@ (mytab.mapstorage).coords[(mytab.mapstorage).graph.target(i)].x, (mytab.mapstorage).coords[(mytab.mapstorage).graph.target(i)].y)); - edgesmap[i]=new BrokenEdge(displayed_graph, coos, *this); + edgesmap[i]=new BrokenEdge(displayed_graph, i, *this); *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green"); edgesmap[i]->property_width_units().set_value(10); edgesmap[i]->lower_to_bottom(); //initializing edge-text as well, to empty string - xy text_pos=edgesmap[i]->getArrowPos(); - text_pos+=(xy(10,10)); + 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, ""); edgetextmap[i]->property_fill_color().set_value("darkgreen"); diff -r 075aaa0a4e6f -r 27a9a75b957b gui/graph_displayer_canvas.h --- a/gui/graph_displayer_canvas.h Wed Dec 14 18:11:03 2005 +0000 +++ b/gui/graph_displayer_canvas.h Sat Dec 17 20:55:41 2005 +0000 @@ -14,12 +14,13 @@ ///This class is the canvas, on which the graph can be drawn. class GraphDisplayerCanvas : public Gnome::Canvas::CanvasAA { + friend class BrokenEdge; + class BrokenEdge : public Gnome::Canvas::Line { + Edge edge; GraphDisplayerCanvas & gdc; Gnome::Canvas::Polygon * arrow; - Gnome::Art::Point * my_points; - ///Indicates whether the button of mouse is pressed or not bool isbutton; @@ -31,10 +32,9 @@ ///event handler for forming edges bool edgeFormerEventHandler(GdkEvent*); public: - BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points, GraphDisplayerCanvas &); + BrokenEdge(Gnome::Canvas::Group &, Edge, GraphDisplayerCanvas &); ~BrokenEdge(); - void setPoints(Gnome::Canvas::Points, bool move=false); - xy getArrowPos(); + void draw(); }; typedef Gnome::Canvas::CanvasAA Parent; @@ -200,6 +200,7 @@ ///reference to the parent window NoteBookTab & mytab; + XY GraphDisplayerCanvas::calcArrowPos(XY, XY, XY, XY, bool); }; #endif //GRAPH_DISPLAYER_CANVAS_H diff -r 075aaa0a4e6f -r 27a9a75b957b gui/gui_reader.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gui/gui_reader.cc Sat Dec 17 20:55:41 2005 +0000 @@ -0,0 +1,33 @@ +#include "gui_reader.h" +#include "xml.h" +#include "mapstorage.h" +#include +#include + +bool GuiReader::header(const std::string& line) +{ + std::istringstream ls(line); + std::string head; + ls >> head; + return head == "@gui"; +} + +void GuiReader::read(std::istream& is) +{ + XmlIo x(is); + std::map > m; + x("arrow_pos", m); + + if ((int)m.size() != countEdges(mapstorage->graph)) return; + + for (EdgeIt e(mapstorage->graph); e != INVALID; ++e) + { + int edgeid = (int)(*mapstorage->edgemap_storage["id"])[e]; + mapstorage->arrow_pos.set(e, m[edgeid]); + } + mapstorage->ArrowPosReadOK(); +} + +GuiReader::GuiReader(LemonReader& reader, MapStorage* ms) : Parent(reader), mapstorage(ms) +{ +} diff -r 075aaa0a4e6f -r 27a9a75b957b gui/gui_reader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gui/gui_reader.h Sat Dec 17 20:55:41 2005 +0000 @@ -0,0 +1,21 @@ +#ifndef GUI_READER_H +#define GUI_READER_H + +#include "mapstorage.h" +#include + +using lemon::LemonReader; + +class GuiReader : public LemonReader::SectionReader +{ + private: + MapStorage* mapstorage; + protected: + virtual bool header(const std::string&); + virtual void read(std::istream&); + public: + typedef LemonReader::SectionReader Parent; + GuiReader(LemonReader&, MapStorage*); +}; + +#endif diff -r 075aaa0a4e6f -r 27a9a75b957b gui/gui_writer.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gui/gui_writer.cc Sat Dec 17 20:55:41 2005 +0000 @@ -0,0 +1,26 @@ +#include "gui_writer.h" +#include "xml.h" +#include "mapstorage.h" +#include +#include + +std::string GuiWriter::header() +{ + return "@gui"; +} + +void GuiWriter::write(std::ostream& os) +{ + XmlIo x(os); + std::map > m; + for (EdgeIt e(mapstorage->graph); e != INVALID; ++e) + { + int edgeid = (int)(*(mapstorage->edgemap_storage["id"]))[e]; + m[edgeid] = mapstorage->arrow_pos[e]; + } + x("arrow_pos", m); +} + +GuiWriter::GuiWriter(LemonWriter& writer, MapStorage* ms) : Parent(writer), mapstorage(ms) +{ +} diff -r 075aaa0a4e6f -r 27a9a75b957b gui/gui_writer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gui/gui_writer.h Sat Dec 17 20:55:41 2005 +0000 @@ -0,0 +1,21 @@ +#ifndef GUI_WRITER_H +#define GUI_WRITER_H + +#include "mapstorage.h" +#include + +using lemon::LemonWriter; + +class GuiWriter : public LemonWriter::SectionWriter +{ + private: + MapStorage* mapstorage; + protected: + virtual std::string header(); + virtual void write(std::ostream&); + public: + typedef LemonWriter::SectionWriter Parent; + GuiWriter(LemonWriter&, MapStorage*); +}; + +#endif diff -r 075aaa0a4e6f -r 27a9a75b957b gui/mapstorage.cc --- a/gui/mapstorage.cc Wed Dec 14 18:11:03 2005 +0000 +++ b/gui/mapstorage.cc Sat Dec 17 20:55:41 2005 +0000 @@ -1,16 +1,23 @@ #include "mapstorage.h" +#include "gui_writer.h" +#include "gui_reader.h" #include #include #include -MapStorage::MapStorage() : modified(false), file_name("") +MapStorage::MapStorage() : modified(false), file_name(""), arrow_pos_read_ok(false) { nodemap_storage["coordinates_x"] = new Graph::NodeMap(graph); coords.setXMap(*nodemap_storage["coordinates_x"]); nodemap_storage["coordinates_y"] = new Graph::NodeMap(graph); coords.setYMap(*nodemap_storage["coordinates_y"]); + edgemap_storage["arrow_pos_x"] = new Graph::EdgeMap(graph); + arrow_pos.setXMap(*edgemap_storage["arrow_pos_x"]); + edgemap_storage["arrow_pos_y"] = new Graph::EdgeMap(graph); + arrow_pos.setYMap(*edgemap_storage["arrow_pos_y"]); + nodemap_storage["id"] = new Graph::NodeMap(graph); edgemap_storage["id"] = new Graph::EdgeMap(graph); @@ -247,6 +254,7 @@ } greader.readEdgeMap(*it, *edgemap_storage[*it]); } + GuiReader gui_reader(greader, this); greader.run(); } catch (DataFormatError& error) { Gtk::MessageDialog mdialog(error.what()); @@ -283,6 +291,15 @@ } } + if (!arrow_pos_read_ok) + { + arrow_pos_read_ok = false; + for (EdgeIt e(graph); e != INVALID; ++e) + { + arrow_pos.set(e, (coords[graph.source(e)] + coords[graph.target(e)]) / 2.0); + } + } + // fill in the default values for the maps for (std::map*>::const_iterator it = nodemap_storage.begin(); it != nodemap_storage.end(); ++it) @@ -338,14 +355,19 @@ nodemap_storage.begin(); it != nodemap_storage.end(); ++it) { gwriter.writeNodeMap(it->first, *(it->second)); - //std::cout << "wrote " << it->first << " nodemap" << std::endl; } for (std::map*>::const_iterator it = edgemap_storage.begin(); it != edgemap_storage.end(); ++it) { - gwriter.writeEdgeMap(it->first, *(it->second)); - //std::cout << "wrote " << it->first << " edgemap" << std::endl; + if ((it->first != "arrow_pos_x") && + (it->first != "arrow_pos_y")) + { + gwriter.writeEdgeMap(it->first, *(it->second)); + } } + + GuiWriter gui_writer(gwriter, this); + gwriter.run(); } @@ -365,7 +387,9 @@ for (std::map*>::iterator it = edgemap_storage.begin(); it != edgemap_storage.end(); ++it) { - if (it->first != "id") + if ((it->first != "id") && + (it->first != "arrow_pos_x") && + (it->first != "arrow_pos_y")) { delete it->second; edgemap_storage.erase(it); @@ -387,3 +411,8 @@ file_name = ""; modified = false; } + +void MapStorage::ArrowPosReadOK() +{ + arrow_pos_read_ok = true; +} diff -r 075aaa0a4e6f -r 27a9a75b957b gui/mapstorage.h --- a/gui/mapstorage.h Wed Dec 14 18:11:03 2005 +0000 +++ b/gui/mapstorage.h Sat Dec 17 20:55:41 2005 +0000 @@ -23,7 +23,10 @@ public: Graph graph; + /// the coordinates of the nodes XYMap > coords; + /// the coordinates of the arrows on the edges + XYMap > arrow_pos; bool modified; std::string file_name; @@ -52,6 +55,8 @@ // Default values for the maps std::map< std::string, double > edgemap_default; + bool arrow_pos_read_ok; + protected: typedef sigc::signal Signal_Prop; Signal_Prop signal_prop; @@ -127,6 +132,8 @@ void writeToFile(const std::string &); void clear(); + + void ArrowPosReadOK(); }; #endif //MAPSTORAGE_H diff -r 075aaa0a4e6f -r 27a9a75b957b gui/xymap.h --- a/gui/xymap.h Wed Dec 14 18:11:03 2005 +0000 +++ b/gui/xymap.h Sat Dec 17 20:55:41 2005 +0000 @@ -4,9 +4,6 @@ #include #include -using lemon::ListGraph; -using lemon::xy; - template class XYMap { @@ -15,7 +12,7 @@ public: typedef typename M::Key Key; - typedef xy Value; + typedef lemon::xy Value; XYMap() {} XYMap(M &_xmap, M &_ymap) : xmap(&_xmap), ymap(&_ymap) {} void setXMap(M &_xmap) { xmap = &_xmap; }