COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
09/21/06 12:29:29 (18 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@2951
Message:

According to xy->Point changement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • graph_displayer_canvas-event.cc

    r149 r150  
    135135
    136136        // write back the new coordinates to the coords map
    137         (mytab.mapstorage).coords.set(active_node, xy<double>(coord_x, coord_y));
     137        (mytab.mapstorage).coords.set(active_node, XY(coord_x, coord_y));
    138138
    139139        clicked_x=new_x;
     
    235235
    236236        //old vector from one to the other node - a
    237         xy<double> a_v(moved_node_1.x-fix_node.x,moved_node_1.y-fix_node.y);
     237        XY a_v(moved_node_1.x-fix_node.x,moved_node_1.y-fix_node.y);
    238238        //new vector from one to the other node - b
    239         xy<double> b_v(moved_node_2.x-fix_node.x,moved_node_2.y-fix_node.y);
     239        XY b_v(moved_node_2.x-fix_node.x,moved_node_2.y-fix_node.y);
    240240
    241241        double absa=sqrt(a_v.normSquare());
     
    249249          {
    250250            //old vector from one node to the breakpoint - c
    251             xy<double> c_v(old_arrow_pos.x-fix_node.x,old_arrow_pos.y-fix_node.y);
     251            XY c_v(old_arrow_pos.x-fix_node.x,old_arrow_pos.y-fix_node.y);
    252252
    253253            //unit vector with the same direction to a_v
    254             xy<double> a_v_u(a_v.x/absa,a_v.y/absa);
     254            XY a_v_u(a_v.x/absa,a_v.y/absa);
    255255
    256256            //normal vector of unit vector with the same direction to a_v
    257             xy<double> a_v_u_n(((-1)*a_v_u.y),a_v_u.x);
     257            XY a_v_u_n(((-1)*a_v_u.y),a_v_u.x);
    258258
    259259            //unit vector with the same direction to b_v
    260             xy<double> b_v_u(b_v.x/absb,b_v.y/absb);
     260            XY b_v_u(b_v.x/absb,b_v.y/absb);
    261261
    262262            //normal vector of unit vector with the same direction to b_v
    263             xy<double> b_v_u_n(((-1)*b_v_u.y),b_v_u.x);
     263            XY b_v_u_n(((-1)*b_v_u.y),b_v_u.x);
    264264
    265265            //vector c in a_v_u and a_v_u_n co-ordinate system
    266             xy<double> c_a(c_v*a_v_u,c_v*a_v_u_n);
     266            XY c_a(c_v*a_v_u,c_v*a_v_u_n);
    267267
    268268            //new vector from one node to the breakpoint - d - we have to calculate this one
    269             xy<double> d_v=absb/absa*(c_a.x*b_v_u+c_a.y*b_v_u_n);
     269            XY d_v=absb/absa*(c_a.x*b_v_u+c_a.y*b_v_u_n);
    270270
    271271            return XY(d_v.x+fix_node.x,d_v.y+fix_node.y);
     
    306306
    307307      // update coordinates
    308       (mytab.mapstorage).coords.set(active_node, xy<double>(clicked_x, clicked_y));
     308      (mytab.mapstorage).coords.set(active_node, XY(clicked_x, clicked_y));
    309309
    310310      // update all other maps
     
    791791}
    792792
    793 void GraphDisplayerCanvas::textReposition(xy<double> new_place)
    794 {
    795   new_place+=(xy<double>(10,10));
     793void GraphDisplayerCanvas::textReposition(XY new_place)
     794{
     795  new_place+=(XY(10,10));
    796796  edgetextmap[forming_edge]->property_x().set_value(new_place.x);
    797797  edgetextmap[forming_edge]->property_y().set_value(new_place.y);
Note: See TracChangeset for help on using the changeset viewer.