COIN-OR::LEMON - Graph Library

Changeset 201:879e47e5b731 in glemon-0.x for gdc-broken_edge.cc


Ignore:
Timestamp:
01/02/08 22:03:09 (16 years ago)
Author:
Akos Ladanyi
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@3431
Message:

Merge branches/akos to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gdc-broken_edge.cc

    r194 r201  
    3737{
    3838  MapStorage& ms = *canvas.mytab.mapstorage;
    39   XY center(ms.arrow_pos[edge]);
     39  XY center(ms.getArrowCoords(edge));
    4040  XY unit_norm_vector(0-unit_vector_in_dir.y, unit_vector_in_dir.x);
    4141
     
    9090
    9191  //calculating coordinates of the direction indicator arrow
    92   XY head(ms.coords[ms.graph.target(edge)]);
    93   XY center(ms.arrow_pos[edge]);
     92  XY head(ms.getNodeCoords(ms.graph.target(edge)));
     93  XY center(ms.getArrowCoords(edge));
    9494
    9595  XY unit_vector_in_dir(head-center);
     
    108108  Node source = ms.graph.source(edge);
    109109  Node target = ms.graph.target(edge);
    110   points.push_back(Gnome::Art::Point(ms.coords[source].x,
    111         ms.coords[source].y));
    112   points.push_back(Gnome::Art::Point(ms.arrow_pos[edge].x,
    113         ms.arrow_pos[edge].y));
    114   points.push_back(Gnome::Art::Point(ms.coords[target].x,
    115         ms.coords[target].y));
     110  points.push_back(Gnome::Art::Point(ms.getNodeCoords(source).x,
     111        ms.getNodeCoords(source).y));
     112  points.push_back(Gnome::Art::Point(ms.getArrowCoords(edge).x,
     113        ms.getArrowCoords(edge).y));
     114  points.push_back(Gnome::Art::Point(ms.getNodeCoords(target).x,
     115        ms.getNodeCoords(target).y));
    116116  line.property_points().set_value(points);
    117117}
     
    153153        Gnome::Canvas::Points points_new;
    154154
    155         canvas.mytab.mapstorage->arrow_pos.set(edge, canvas.mytab.mapstorage->arrow_pos[edge] + XY(dx, dy));
     155        canvas.mytab.mapstorage->setArrowCoords(edge, canvas.mytab.mapstorage->getArrowCoords(edge) + XY(dx, dy));
    156156
    157157        draw();
    158         canvas.textReposition(canvas.mytab.mapstorage->arrow_pos[edge]);
     158        canvas.textReposition(canvas.mytab.mapstorage->getArrowCoords(edge));
    159159
    160160        clicked_x=e->motion.x;
     
    200200
    201201  Node node = ms.graph.source(edge);
    202   XY center = (ms.coords[node] + ms.arrow_pos[edge]) / 2.0;
    203 
    204   XY unit_vector_in_dir(rot90(center - ms.arrow_pos[edge]));
     202  XY center = (ms.getNodeCoords(node) + ms.getArrowCoords(edge)) / 2.0;
     203
     204  XY unit_vector_in_dir(rot90(center - ms.getArrowCoords(edge)));
    205205  double length = sqrt(unit_vector_in_dir.normSquare());
    206206  unit_vector_in_dir /= length;
     
    209209
    210210  double radius =
    211     sqrt((ms.arrow_pos[edge] - ms.coords[node]).normSquare()) / 2.0;
     211    sqrt((ms.getArrowCoords(edge) - ms.getNodeCoords(node)).normSquare()) / 2.0;
    212212
    213213  XY p1 = center + XY(-radius,  radius);
     
    250250      if(isbutton)
    251251      {
    252         canvas.mytab.mapstorage->arrow_pos.set(edge, XY(e->motion.x, e->motion.y));
     252        canvas.mytab.mapstorage->setArrowCoords(edge, XY(e->motion.x, e->motion.y));
    253253
    254254        draw();
    255         canvas.textReposition(canvas.mytab.mapstorage->arrow_pos[edge]);
     255        canvas.textReposition(canvas.mytab.mapstorage->getArrowCoords(edge));
    256256      }
    257257    default: break;
Note: See TracChangeset for help on using the changeset viewer.