According to xy->Point changement.
authorhegyi
Thu, 21 Sep 2006 10:29:29 +0000
changeset 15086273bfe0e4d
parent 149 930e838ad5b6
child 151 72f1c33f89d4
According to xy->Point changement.
all_include.h
graph_displayer_canvas-event.cc
graph_displayer_canvas.cc
graph_displayer_canvas.h
gui_reader.cc
gui_writer.cc
xml.h
xymap.h
     1.1 --- a/all_include.h	Tue Sep 19 07:43:55 2006 +0000
     1.2 +++ b/all_include.h	Thu Sep 21 10:29:29 2006 +0000
     1.3 @@ -14,7 +14,7 @@
     1.4  #include <lemon/graph_utils.h>
     1.5  #include <lemon/maps.h>
     1.6  #include <lemon/error.h>
     1.7 -#include <lemon/xy.h>
     1.8 +#include <lemon/dim2.h>
     1.9  
    1.10  enum {E_WIDTH, E_COLOR, E_TEXT, EDGE_PROPERTY_NUM}; // edge properties;
    1.11  enum {N_RADIUS, N_COLOR, N_TEXT, NODE_PROPERTY_NUM}; // node properties;
    1.12 @@ -37,7 +37,7 @@
    1.13  
    1.14  using namespace lemon;
    1.15  
    1.16 -typedef xy<double> XY;
    1.17 +typedef lemon::dim2::Point<double> XY;
    1.18  typedef ListGraph Graph;
    1.19  typedef Graph::Node Node;
    1.20  typedef Graph::Edge Edge;
     2.1 --- a/graph_displayer_canvas-event.cc	Tue Sep 19 07:43:55 2006 +0000
     2.2 +++ b/graph_displayer_canvas-event.cc	Thu Sep 21 10:29:29 2006 +0000
     2.3 @@ -134,7 +134,7 @@
     2.4          double coord_y = new_y - (clicked_y - (mytab.mapstorage).coords[active_node].y);
     2.5  
     2.6          // write back the new coordinates to the coords map
     2.7 -        (mytab.mapstorage).coords.set(active_node, xy<double>(coord_x, coord_y));
     2.8 +        (mytab.mapstorage).coords.set(active_node, XY(coord_x, coord_y));
     2.9  
    2.10          clicked_x=new_x;
    2.11          clicked_y=new_y;
    2.12 @@ -234,9 +234,9 @@
    2.13  	//////////////////////////////////////////////////////////////////////////////////////////////////////
    2.14  
    2.15  	//old vector from one to the other node - a
    2.16 -	xy<double> a_v(moved_node_1.x-fix_node.x,moved_node_1.y-fix_node.y);
    2.17 +	XY a_v(moved_node_1.x-fix_node.x,moved_node_1.y-fix_node.y);
    2.18  	//new vector from one to the other node - b
    2.19 -	xy<double> b_v(moved_node_2.x-fix_node.x,moved_node_2.y-fix_node.y);
    2.20 +	XY b_v(moved_node_2.x-fix_node.x,moved_node_2.y-fix_node.y);
    2.21  
    2.22  	double absa=sqrt(a_v.normSquare());
    2.23  	double absb=sqrt(b_v.normSquare());
    2.24 @@ -248,25 +248,25 @@
    2.25  	else
    2.26  	  {
    2.27  	    //old vector from one node to the breakpoint - c
    2.28 -	    xy<double> c_v(old_arrow_pos.x-fix_node.x,old_arrow_pos.y-fix_node.y);
    2.29 +	    XY c_v(old_arrow_pos.x-fix_node.x,old_arrow_pos.y-fix_node.y);
    2.30  
    2.31  	    //unit vector with the same direction to a_v
    2.32 -	    xy<double> a_v_u(a_v.x/absa,a_v.y/absa);
    2.33 +	    XY a_v_u(a_v.x/absa,a_v.y/absa);
    2.34  
    2.35  	    //normal vector of unit vector with the same direction to a_v
    2.36 -	    xy<double> a_v_u_n(((-1)*a_v_u.y),a_v_u.x);
    2.37 +	    XY a_v_u_n(((-1)*a_v_u.y),a_v_u.x);
    2.38  
    2.39  	    //unit vector with the same direction to b_v
    2.40 -	    xy<double> b_v_u(b_v.x/absb,b_v.y/absb);
    2.41 +	    XY b_v_u(b_v.x/absb,b_v.y/absb);
    2.42  
    2.43  	    //normal vector of unit vector with the same direction to b_v
    2.44 -	    xy<double> b_v_u_n(((-1)*b_v_u.y),b_v_u.x);
    2.45 +	    XY b_v_u_n(((-1)*b_v_u.y),b_v_u.x);
    2.46  
    2.47  	    //vector c in a_v_u and a_v_u_n co-ordinate system
    2.48 -	    xy<double> c_a(c_v*a_v_u,c_v*a_v_u_n);
    2.49 +	    XY c_a(c_v*a_v_u,c_v*a_v_u_n);
    2.50  
    2.51  	    //new vector from one node to the breakpoint - d - we have to calculate this one
    2.52 -	    xy<double> d_v=absb/absa*(c_a.x*b_v_u+c_a.y*b_v_u_n);
    2.53 +	    XY d_v=absb/absa*(c_a.x*b_v_u+c_a.y*b_v_u_n);
    2.54  
    2.55  	    return XY(d_v.x+fix_node.x,d_v.y+fix_node.y);
    2.56  	  }
    2.57 @@ -305,7 +305,7 @@
    2.58        window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
    2.59  
    2.60        // update coordinates
    2.61 -      (mytab.mapstorage).coords.set(active_node, xy<double>(clicked_x, clicked_y));
    2.62 +      (mytab.mapstorage).coords.set(active_node, XY(clicked_x, clicked_y));
    2.63  
    2.64        // update all other maps
    2.65        for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
    2.66 @@ -790,9 +790,9 @@
    2.67    (mytab.mapstorage).graph.erase(edge_to_delete);
    2.68  }
    2.69  
    2.70 -void GraphDisplayerCanvas::textReposition(xy<double> new_place)
    2.71 +void GraphDisplayerCanvas::textReposition(XY new_place)
    2.72  {
    2.73 -  new_place+=(xy<double>(10,10));
    2.74 +  new_place+=(XY(10,10));
    2.75    edgetextmap[forming_edge]->property_x().set_value(new_place.x);
    2.76    edgetextmap[forming_edge]->property_y().set_value(new_place.y);
    2.77  }
     3.1 --- a/graph_displayer_canvas.cc	Tue Sep 19 07:43:55 2006 +0000
     3.2 +++ b/graph_displayer_canvas.cc	Thu Sep 21 10:29:29 2006 +0000
     3.3 @@ -199,7 +199,7 @@
     3.4  
     3.5      //initializing edge-text as well, to empty string
     3.6  
     3.7 -    xy<double> text_pos(
     3.8 +    XY text_pos(
     3.9          ((mytab.mapstorage).coords[i].x+node_property_defaults[N_RADIUS]+5),
    3.10          ((mytab.mapstorage).coords[i].y+node_property_defaults[N_RADIUS]+5));
    3.11  
     4.1 --- a/graph_displayer_canvas.h	Tue Sep 19 07:43:55 2006 +0000
     4.2 +++ b/graph_displayer_canvas.h	Thu Sep 21 10:29:29 2006 +0000
     4.3 @@ -9,7 +9,7 @@
     4.4  #include "nbtab.h"
     4.5  #include <libgnomecanvasmm.h>
     4.6  #include <libgnomecanvasmm/polygon.h>
     4.7 -#include <lemon/xy.h>
     4.8 +#include <lemon/dim2.h>
     4.9  
    4.10  ///This class is the canvas, on which the graph can be drawn.
    4.11  class GraphDisplayerCanvas : public Gnome::Canvas::CanvasAA
    4.12 @@ -268,7 +268,7 @@
    4.13  
    4.14  public:
    4.15    ///Moves the text to new place
    4.16 -  void textReposition(xy<double>);
    4.17 +  void textReposition(XY);
    4.18  
    4.19    ///Activates an edge belonging to an EdgeBase
    4.20  
     5.1 --- a/gui_reader.cc	Tue Sep 19 07:43:55 2006 +0000
     5.2 +++ b/gui_reader.cc	Thu Sep 21 10:29:29 2006 +0000
     5.3 @@ -1,7 +1,7 @@
     5.4  #include "gui_reader.h"
     5.5  #include "xml.h"
     5.6  #include "mapstorage.h"
     5.7 -#include <lemon/xy.h>
     5.8 +#include <lemon/dim2.h>
     5.9  #include <vector>
    5.10  
    5.11  bool GuiReader::header(const std::string& line)
    5.12 @@ -15,7 +15,7 @@
    5.13  void GuiReader::read(std::istream& is)
    5.14  {
    5.15    XmlIo x(is);
    5.16 -  std::map<int, xy<double> > m;
    5.17 +  std::map<int, XY > m;
    5.18    x("arrow_pos", m);
    5.19  
    5.20    if ((int)m.size() != countEdges(mapstorage->graph)) return;
     6.1 --- a/gui_writer.cc	Tue Sep 19 07:43:55 2006 +0000
     6.2 +++ b/gui_writer.cc	Thu Sep 21 10:29:29 2006 +0000
     6.3 @@ -1,7 +1,7 @@
     6.4  #include "gui_writer.h"
     6.5  #include "xml.h"
     6.6  #include "mapstorage.h"
     6.7 -#include <lemon/xy.h>
     6.8 +#include <lemon/dim2.h>
     6.9  #include <vector>
    6.10  
    6.11  std::string GuiWriter::header()
    6.12 @@ -12,7 +12,7 @@
    6.13  void GuiWriter::write(std::ostream& os)
    6.14  {
    6.15    XmlIo x(os);
    6.16 -  std::map<int, xy<double> > m;
    6.17 +  std::map<int, XY > m;
    6.18    for (EdgeIt e(mapstorage->graph); e != INVALID; ++e)
    6.19    {
    6.20      int edgeid = (int)(*(mapstorage->edgemap_storage["label"]))[e];
     7.1 --- a/xml.h	Tue Sep 19 07:43:55 2006 +0000
     7.2 +++ b/xml.h	Thu Sep 21 10:29:29 2006 +0000
     7.3 @@ -20,7 +20,7 @@
     7.4  #include <list>
     7.5  #include <map>
     7.6  #include <lemon/error.h>
     7.7 -#include <lemon/xy.h>
     7.8 +#include <lemon/dim2.h>
     7.9  
    7.10  namespace lemon {
    7.11  
    7.12 @@ -409,7 +409,7 @@
    7.13    ///\relates XmlIo
    7.14    ///
    7.15    template<class T>
    7.16 -  void xml(XmlIo &x,lemon::xy<T> &v)
    7.17 +  void xml(XmlIo &x,lemon::dim2::Point<T> &v)
    7.18    {
    7.19      { XmlIo::LineTag t(x,"x"); x(v.x); }
    7.20      { XmlIo::ContTag t(x,"y"); x(v.y); }
    7.21 @@ -420,7 +420,7 @@
    7.22    ///\relates XmlIo
    7.23    ///
    7.24    template<class T>
    7.25 -  void xml(XmlIo &x,lemon::BoundingBox<T> &v)
    7.26 +  void xml(XmlIo &x,lemon::dim2::BoundingBox<T> &v)
    7.27    {
    7.28      if(x.write()) {
    7.29        if(!v.empty()) {
    7.30 @@ -431,7 +431,7 @@
    7.31      else {
    7.32        v.clear();
    7.33        while(x.nextTag()=="point") {
    7.34 -	lemon::xy<T> co;
    7.35 +	lemon::dim2::Point<T> co;
    7.36  	x("point",co);
    7.37  	v.add(co);
    7.38        }
     8.1 --- a/xymap.h	Tue Sep 19 07:43:55 2006 +0000
     8.2 +++ b/xymap.h	Thu Sep 21 10:29:29 2006 +0000
     8.3 @@ -2,7 +2,7 @@
     8.4  #define XYMAP_H
     8.5  
     8.6  #include <lemon/list_graph.h>
     8.7 -#include <lemon/xy.h>
     8.8 +#include <lemon/dim2.h>
     8.9  
    8.10  template<class M>
    8.11  class XYMap
    8.12 @@ -12,7 +12,7 @@
    8.13  
    8.14    public:
    8.15      typedef typename M::Key Key;
    8.16 -    typedef lemon::xy<typename M::Value> Value;
    8.17 +    typedef lemon::dim2::Point<typename M::Value> Value;
    8.18      XYMap() {}
    8.19      XYMap(M &_xmap, M &_ymap) : xmap(&_xmap), ymap(&_ymap) {}
    8.20      void setXMap(M &_xmap) { xmap = &_xmap; }