Changeset 201:879e47e5b731 in glemon-0.x for gdc-broken_edge.cc
- Timestamp:
- 01/02/08 22:03:09 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@3431
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gdc-broken_edge.cc
r194 r201 37 37 { 38 38 MapStorage& ms = *canvas.mytab.mapstorage; 39 XY center(ms. arrow_pos[edge]);39 XY center(ms.getArrowCoords(edge)); 40 40 XY unit_norm_vector(0-unit_vector_in_dir.y, unit_vector_in_dir.x); 41 41 … … 90 90 91 91 //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)); 94 94 95 95 XY unit_vector_in_dir(head-center); … … 108 108 Node source = ms.graph.source(edge); 109 109 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)); 116 116 line.property_points().set_value(points); 117 117 } … … 153 153 Gnome::Canvas::Points points_new; 154 154 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)); 156 156 157 157 draw(); 158 canvas.textReposition(canvas.mytab.mapstorage-> arrow_pos[edge]);158 canvas.textReposition(canvas.mytab.mapstorage->getArrowCoords(edge)); 159 159 160 160 clicked_x=e->motion.x; … … 200 200 201 201 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))); 205 205 double length = sqrt(unit_vector_in_dir.normSquare()); 206 206 unit_vector_in_dir /= length; … … 209 209 210 210 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; 212 212 213 213 XY p1 = center + XY(-radius, radius); … … 250 250 if(isbutton) 251 251 { 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)); 253 253 254 254 draw(); 255 canvas.textReposition(canvas.mytab.mapstorage-> arrow_pos[edge]);255 canvas.textReposition(canvas.mytab.mapstorage->getArrowCoords(edge)); 256 256 } 257 257 default: break;
Note: See TracChangeset
for help on using the changeset viewer.