# HG changeset patch # User hegyi # Date 1158834569 0 # Node ID 86273bfe0e4d9b29e24341b8eb51dba4abddb44f # Parent 930e838ad5b6743710514839abf9209940df0151 According to xy->Point changement. diff -r 930e838ad5b6 -r 86273bfe0e4d all_include.h --- a/all_include.h Tue Sep 19 07:43:55 2006 +0000 +++ b/all_include.h Thu Sep 21 10:29:29 2006 +0000 @@ -14,7 +14,7 @@ #include #include #include -#include +#include enum {E_WIDTH, E_COLOR, E_TEXT, EDGE_PROPERTY_NUM}; // edge properties; enum {N_RADIUS, N_COLOR, N_TEXT, NODE_PROPERTY_NUM}; // node properties; @@ -37,7 +37,7 @@ using namespace lemon; -typedef xy XY; +typedef lemon::dim2::Point XY; typedef ListGraph Graph; typedef Graph::Node Node; typedef Graph::Edge Edge; diff -r 930e838ad5b6 -r 86273bfe0e4d graph_displayer_canvas-event.cc --- a/graph_displayer_canvas-event.cc Tue Sep 19 07:43:55 2006 +0000 +++ b/graph_displayer_canvas-event.cc Thu Sep 21 10:29:29 2006 +0000 @@ -134,7 +134,7 @@ 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)); + (mytab.mapstorage).coords.set(active_node, XY(coord_x, coord_y)); clicked_x=new_x; clicked_y=new_y; @@ -234,9 +234,9 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////// //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); + 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); + 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()); @@ -248,25 +248,25 @@ 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); + 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); + 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); + 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); + 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); + 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); + 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); + 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); } @@ -305,7 +305,7 @@ 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 = @@ -790,9 +790,9 @@ (mytab.mapstorage).graph.erase(edge_to_delete); } -void GraphDisplayerCanvas::textReposition(xy new_place) +void GraphDisplayerCanvas::textReposition(XY new_place) { - new_place+=(xy(10,10)); + new_place+=(XY(10,10)); edgetextmap[forming_edge]->property_x().set_value(new_place.x); edgetextmap[forming_edge]->property_y().set_value(new_place.y); } diff -r 930e838ad5b6 -r 86273bfe0e4d graph_displayer_canvas.cc --- a/graph_displayer_canvas.cc Tue Sep 19 07:43:55 2006 +0000 +++ b/graph_displayer_canvas.cc Thu Sep 21 10:29:29 2006 +0000 @@ -199,7 +199,7 @@ //initializing edge-text as well, to empty string - xy text_pos( + 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)); diff -r 930e838ad5b6 -r 86273bfe0e4d graph_displayer_canvas.h --- a/graph_displayer_canvas.h Tue Sep 19 07:43:55 2006 +0000 +++ b/graph_displayer_canvas.h Thu Sep 21 10:29:29 2006 +0000 @@ -9,7 +9,7 @@ #include "nbtab.h" #include #include -#include +#include ///This class is the canvas, on which the graph can be drawn. class GraphDisplayerCanvas : public Gnome::Canvas::CanvasAA @@ -268,7 +268,7 @@ public: ///Moves the text to new place - void textReposition(xy); + void textReposition(XY); ///Activates an edge belonging to an EdgeBase diff -r 930e838ad5b6 -r 86273bfe0e4d gui_reader.cc --- a/gui_reader.cc Tue Sep 19 07:43:55 2006 +0000 +++ b/gui_reader.cc Thu Sep 21 10:29:29 2006 +0000 @@ -1,7 +1,7 @@ #include "gui_reader.h" #include "xml.h" #include "mapstorage.h" -#include +#include #include bool GuiReader::header(const std::string& line) @@ -15,7 +15,7 @@ void GuiReader::read(std::istream& is) { XmlIo x(is); - std::map > m; + std::map m; x("arrow_pos", m); if ((int)m.size() != countEdges(mapstorage->graph)) return; diff -r 930e838ad5b6 -r 86273bfe0e4d gui_writer.cc --- a/gui_writer.cc Tue Sep 19 07:43:55 2006 +0000 +++ b/gui_writer.cc Thu Sep 21 10:29:29 2006 +0000 @@ -1,7 +1,7 @@ #include "gui_writer.h" #include "xml.h" #include "mapstorage.h" -#include +#include #include std::string GuiWriter::header() @@ -12,7 +12,7 @@ void GuiWriter::write(std::ostream& os) { XmlIo x(os); - std::map > m; + std::map m; for (EdgeIt e(mapstorage->graph); e != INVALID; ++e) { int edgeid = (int)(*(mapstorage->edgemap_storage["label"]))[e]; diff -r 930e838ad5b6 -r 86273bfe0e4d xml.h --- a/xml.h Tue Sep 19 07:43:55 2006 +0000 +++ b/xml.h Thu Sep 21 10:29:29 2006 +0000 @@ -20,7 +20,7 @@ #include #include #include -#include +#include namespace lemon { @@ -409,7 +409,7 @@ ///\relates XmlIo /// template - void xml(XmlIo &x,lemon::xy &v) + void xml(XmlIo &x,lemon::dim2::Point &v) { { XmlIo::LineTag t(x,"x"); x(v.x); } { XmlIo::ContTag t(x,"y"); x(v.y); } @@ -420,7 +420,7 @@ ///\relates XmlIo /// template - void xml(XmlIo &x,lemon::BoundingBox &v) + void xml(XmlIo &x,lemon::dim2::BoundingBox &v) { if(x.write()) { if(!v.empty()) { @@ -431,7 +431,7 @@ else { v.clear(); while(x.nextTag()=="point") { - lemon::xy co; + lemon::dim2::Point co; x("point",co); v.add(co); } diff -r 930e838ad5b6 -r 86273bfe0e4d xymap.h --- a/xymap.h Tue Sep 19 07:43:55 2006 +0000 +++ b/xymap.h Thu Sep 21 10:29:29 2006 +0000 @@ -2,7 +2,7 @@ #define XYMAP_H #include -#include +#include template class XYMap @@ -12,7 +12,7 @@ public: typedef typename M::Key Key; - typedef lemon::xy Value; + typedef lemon::dim2::Point Value; XYMap() {} XYMap(M &_xmap, M &_ymap) : xmap(&_xmap), ymap(&_ymap) {} void setXMap(M &_xmap) { xmap = &_xmap; }