Changeset 31:66e85f44a66f in glemon-0.x for graph_displayer_canvas-node.cc
- Timestamp:
- 06/29/05 21:44:30 (19 years ago)
- Branch:
- gui
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk/gui@2011
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
graph_displayer_canvas-node.cc
r28 r31 6 6 int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Graph::Node node) 7 7 { 8 Graph::NodeMap<double> * actual_map; 9 if(mapname=="Default") 10 { 11 actual_map=new Graph::NodeMap<double>(g,node_property_defaults[N_RADIUS]); 12 } 13 else 14 { 15 actual_map=(mapstorage.nodemap_storage)[mapname]; 16 } 17 8 18 if(node==INVALID) 9 19 { 10 20 for (NodeIt i(g); i!=INVALID; ++i) 11 21 { 12 int w=(int)(* (mapstorage.nodemap_storage)[mapname])[i];22 int w=(int)(*actual_map)[i]; 13 23 if(w>=0) 14 24 { 15 25 double x1, y1, x2, y2; 16 nodesmap[i]->get_bounds(x1, y1, x2, y2); 26 x1=nodesmap[i]->property_x1().get_value(); 27 x2=nodesmap[i]->property_x2().get_value(); 28 y1=nodesmap[i]->property_y1().get_value(); 29 y2=nodesmap[i]->property_y2().get_value(); 17 30 nodesmap[i]->property_x1().set_value((x1+x2)/2-w); 18 31 nodesmap[i]->property_x2().set_value((x1+x2)/2+w); … … 24 37 else 25 38 { 26 int w=(int)(*(mapstorage.nodemap_storage)[mapname])[node]; 39 //I think only new nodes use this case 40 // int w=(int)(*actual_map)[node]; 41 int w=(int)(node_property_defaults[N_RADIUS]); 27 42 if(w>=0) 28 43 { 29 44 double x1, y1, x2, y2; 30 nodesmap[node]->get_bounds(x1, y1, x2, y2); 45 x1=nodesmap[node]->property_x1().get_value(); 46 x2=nodesmap[node]->property_x2().get_value(); 47 y1=nodesmap[node]->property_y1().get_value(); 48 y2=nodesmap[node]->property_y2().get_value(); 31 49 nodesmap[node]->property_x1().set_value((x1+x2)/2-w); 32 50 nodesmap[node]->property_x2().set_value((x1+x2)/2+w); … … 45 63 //green in RGB 46 64 65 Graph::NodeMap<double> * actual_map; 66 if(mapname=="Default") 67 { 68 actual_map=new Graph::NodeMap<double>(g,node_property_defaults[N_COLOR]); 69 } 70 else 71 { 72 actual_map=(mapstorage.nodemap_storage)[mapname]; 73 } 74 75 double max, min; 76 77 if(mapname!="Default") 78 { 79 max=mapstorage.maxOfNodeMap(mapname); 80 min=mapstorage.minOfNodeMap(mapname); 81 } 82 else 83 { 84 max=node_property_defaults[N_COLOR]; 85 min=node_property_defaults[N_COLOR]; 86 } 87 88 47 89 if(node==INVALID) 48 90 { … … 50 92 for (NodeIt i(g); i!=INVALID; ++i) 51 93 { 52 double w=(*(mapstorage.nodemap_storage)[mapname])[i];53 double max=mapstorage.maxOfNodeMap(mapname);54 double min=mapstorage.minOfNodeMap(mapname);55 56 //std::cout<<w<<" "<<max<<" "<<min<<" "<<100*(w-min)/(max-min)<<std::endl;57 94 Gdk::Color color; 95 96 double w=(*actual_map)[i]; 97 58 98 if(max!=min) 59 99 { … … 70 110 else 71 111 { 72 double w=(*(mapstorage.nodemap_storage)[mapname])[node];73 double max=mapstorage.maxOfNodeMap(mapname);74 double min=mapstorage.minOfNodeMap(mapname);75 76 //std::cout<<w<<" "<<max<<" "<<min<<" "<<100*(w-min)/(max-min)<<std::endl;77 112 Gdk::Color color; 113 114 double w=(*actual_map)[node]; 115 78 116 if(max!=min) 79 117 { … … 97 135 //in that case empty string will be written, because 98 136 //that is the deleter map 99 //\todo isn't it a bit woodcutter? 137 138 Graph::NodeMap<double> * actual_map; 139 if(mapname=="Default") 140 { 141 actual_map=new Graph::NodeMap<double>(g,node_property_defaults[N_COLOR]); 142 } 143 else 144 { 145 actual_map=(mapstorage.nodemap_storage)[mapname]; 146 } 100 147 101 148 if(node==INVALID) … … 103 150 for (NodeIt i(g); i!=INVALID; ++i) 104 151 { 105 if(mapname!= node_property_strings[N_TEXT])106 { 107 double number=(* (mapstorage.nodemap_storage)[mapname])[i];152 if(mapname!="Default") 153 { 154 double number=(*actual_map)[i]; 108 155 int length=1; 109 156 //if number is smaller than one, length would be negative, or invalid … … 139 186 else 140 187 { 141 if(mapname!= node_property_strings[N_TEXT])142 { 143 double number=(* (mapstorage.nodemap_storage)[mapname])[node];188 if(mapname!="Default") 189 { 190 double number=(*actual_map)[node]; 144 191 int length=1; 145 192 //if number is smaller than one, length would be negative, or invalid
Note: See TracChangeset
for help on using the changeset viewer.