equal
deleted
inserted
replaced
1 #include "graph_displayer_canvas.h" |
1 #include "graph_displayer_canvas.h" |
2 #include <cmath> |
2 #include <cmath> |
3 |
3 |
|
4 const int minimum_node_radius=0; |
4 |
5 |
5 int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Node node) |
6 int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Node node) |
6 { |
7 { |
7 Graph::NodeMap<double> * actual_map; |
8 Graph::NodeMap<double> * actual_map; |
8 double min, max; |
9 double min, max; |
22 { |
23 { |
23 w=(int)(node_property_defaults[N_RADIUS]); |
24 w=(int)(node_property_defaults[N_RADIUS]); |
24 } |
25 } |
25 else |
26 else |
26 { |
27 { |
27 w=(int)(radius_min+(v-min)/(max-min)*(radius_max-radius_min)); |
28 w=(int)(minimum_node_radius+(v-min)/(max-min)*(radius_max-minimum_node_radius)); |
28 } |
29 } |
29 } |
30 } |
30 else |
31 else |
31 { |
32 { |
32 w=5+(int)(v/radius_unit); |
33 w=(int)(v*radius_max); |
33 } |
34 } |
|
35 |
|
36 if(w<5) |
|
37 { |
|
38 w=5; |
|
39 } |
|
40 |
34 if(w>=0) |
41 if(w>=0) |
35 { |
42 { |
36 double x1, y1, x2, y2; |
43 double x1, y1, x2, y2; |
37 x1=nodesmap[i]->property_x1().get_value(); |
44 x1=nodesmap[i]->property_x1().get_value(); |
38 x2=nodesmap[i]->property_x2().get_value(); |
45 x2=nodesmap[i]->property_x2().get_value(); |