Changeset 150:86273bfe0e4d in glemon-0.x
- Timestamp:
- 09/21/06 12:29:29 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@2951
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
all_include.h
r149 r150 15 15 #include <lemon/maps.h> 16 16 #include <lemon/error.h> 17 #include <lemon/ xy.h>17 #include <lemon/dim2.h> 18 18 19 19 enum {E_WIDTH, E_COLOR, E_TEXT, EDGE_PROPERTY_NUM}; // edge properties; … … 38 38 using namespace lemon; 39 39 40 typedef xy<double> XY;40 typedef lemon::dim2::Point<double> XY; 41 41 typedef ListGraph Graph; 42 42 typedef Graph::Node Node; -
graph_displayer_canvas-event.cc
r149 r150 135 135 136 136 // 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)); 138 138 139 139 clicked_x=new_x; … … 235 235 236 236 //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); 238 238 //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); 240 240 241 241 double absa=sqrt(a_v.normSquare()); … … 249 249 { 250 250 //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); 252 252 253 253 //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); 255 255 256 256 //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); 258 258 259 259 //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); 261 261 262 262 //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); 264 264 265 265 //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); 267 267 268 268 //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); 270 270 271 271 return XY(d_v.x+fix_node.x,d_v.y+fix_node.y); … … 306 306 307 307 // 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)); 309 309 310 310 // update all other maps … … 791 791 } 792 792 793 void GraphDisplayerCanvas::textReposition( xy<double>new_place)794 { 795 new_place+=( xy<double>(10,10));793 void GraphDisplayerCanvas::textReposition(XY new_place) 794 { 795 new_place+=(XY(10,10)); 796 796 edgetextmap[forming_edge]->property_x().set_value(new_place.x); 797 797 edgetextmap[forming_edge]->property_y().set_value(new_place.y); -
graph_displayer_canvas.cc
r149 r150 200 200 //initializing edge-text as well, to empty string 201 201 202 xy<double>text_pos(202 XY text_pos( 203 203 ((mytab.mapstorage).coords[i].x+node_property_defaults[N_RADIUS]+5), 204 204 ((mytab.mapstorage).coords[i].y+node_property_defaults[N_RADIUS]+5)); -
graph_displayer_canvas.h
r149 r150 10 10 #include <libgnomecanvasmm.h> 11 11 #include <libgnomecanvasmm/polygon.h> 12 #include <lemon/ xy.h>12 #include <lemon/dim2.h> 13 13 14 14 ///This class is the canvas, on which the graph can be drawn. … … 269 269 public: 270 270 ///Moves the text to new place 271 void textReposition( xy<double>);271 void textReposition(XY); 272 272 273 273 ///Activates an edge belonging to an EdgeBase -
gui_reader.cc
r134 r150 2 2 #include "xml.h" 3 3 #include "mapstorage.h" 4 #include <lemon/ xy.h>4 #include <lemon/dim2.h> 5 5 #include <vector> 6 6 … … 16 16 { 17 17 XmlIo x(is); 18 std::map<int, xy<double>> m;18 std::map<int, XY > m; 19 19 x("arrow_pos", m); 20 20 -
gui_writer.cc
r134 r150 2 2 #include "xml.h" 3 3 #include "mapstorage.h" 4 #include <lemon/ xy.h>4 #include <lemon/dim2.h> 5 5 #include <vector> 6 6 … … 13 13 { 14 14 XmlIo x(os); 15 std::map<int, xy<double>> m;15 std::map<int, XY > m; 16 16 for (EdgeIt e(mapstorage->graph); e != INVALID; ++e) 17 17 { -
xml.h
r127 r150 21 21 #include <map> 22 22 #include <lemon/error.h> 23 #include <lemon/ xy.h>23 #include <lemon/dim2.h> 24 24 25 25 namespace lemon { … … 410 410 /// 411 411 template<class T> 412 void xml(XmlIo &x,lemon:: xy<T> &v)412 void xml(XmlIo &x,lemon::dim2::Point<T> &v) 413 413 { 414 414 { XmlIo::LineTag t(x,"x"); x(v.x); } … … 421 421 /// 422 422 template<class T> 423 void xml(XmlIo &x,lemon:: BoundingBox<T> &v)423 void xml(XmlIo &x,lemon::dim2::BoundingBox<T> &v) 424 424 { 425 425 if(x.write()) { … … 432 432 v.clear(); 433 433 while(x.nextTag()=="point") { 434 lemon:: xy<T> co;434 lemon::dim2::Point<T> co; 435 435 x("point",co); 436 436 v.add(co); -
xymap.h
r98 r150 3 3 4 4 #include <lemon/list_graph.h> 5 #include <lemon/ xy.h>5 #include <lemon/dim2.h> 6 6 7 7 template<class M> … … 13 13 public: 14 14 typedef typename M::Key Key; 15 typedef lemon:: xy<typename M::Value> Value;15 typedef lemon::dim2::Point<typename M::Value> Value; 16 16 XYMap() {} 17 17 XYMap(M &_xmap, M &_ymap) : xmap(&_xmap), ymap(&_ymap) {}
Note: See TracChangeset
for help on using the changeset viewer.