graph_displayer_canvas.cc
changeset 167 30a7be486475
parent 166 302d75b08b27
child 168 a5f82cbbc1e4
equal deleted inserted replaced
46:7b26bf746bfa 47:5849cf4e812f
     1 #include "graph_displayer_canvas.h"
     1 #include "graph_displayer_canvas.h"
       
     2 #include <lemon/random.h>
     2 #include <cmath>
     3 #include <cmath>
     3 
     4 
     4 GraphDisplayerCanvas::GraphDisplayerCanvas(NoteBookTab & mainw) :
     5 GraphDisplayerCanvas::GraphDisplayerCanvas(NoteBookTab & mainw) :
     5   nodesmap(mainw.mapstorage.graph), edgesmap(mainw.mapstorage.graph), edgetextmap(mainw.mapstorage.graph),
     6   nodesmap(mainw.mapstorage.graph), edgesmap(mainw.mapstorage.graph), edgetextmap(mainw.mapstorage.graph),
     6   nodetextmap(mainw.mapstorage.graph), displayed_graph(*(root()), 0, 0),
     7   nodetextmap(mainw.mapstorage.graph), displayed_graph(*(root()), 0, 0),
   259   double init_vector_length=25;
   260   double init_vector_length=25;
   260 
   261 
   261   if(!was_redesigned)
   262   if(!was_redesigned)
   262     {
   263     {
   263       NodeIt i((mytab.mapstorage).graph);
   264       NodeIt i((mytab.mapstorage).graph);
   264       double r=random();
   265 
       
   266       double r=Random().getReal();
       
   267 
   265       dim2::Point<double> init(init_vector_length*sin(r),init_vector_length*cos(r));
   268       dim2::Point<double> init(init_vector_length*sin(r),init_vector_length*cos(r));
   266       moveNode(init.x, init.y, nodesmap[i], i);
   269       moveNode(init.x, init.y, nodesmap[i], i);
   267       was_redesigned=true;
   270       was_redesigned=true;
   268     }
   271     }
   269   
   272