equal
deleted
inserted
replaced
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 |