diff -r f70bbee5350a -r 66e85f44a66f graph_displayer_canvas-node.cc --- a/graph_displayer_canvas-node.cc Wed Jun 29 15:41:33 2005 +0000 +++ b/graph_displayer_canvas-node.cc Wed Jun 29 19:44:30 2005 +0000 @@ -5,15 +5,28 @@ int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Graph::Node node) { + Graph::NodeMap * actual_map; + if(mapname=="Default") + { + actual_map=new Graph::NodeMap(g,node_property_defaults[N_RADIUS]); + } + else + { + actual_map=(mapstorage.nodemap_storage)[mapname]; + } + if(node==INVALID) { for (NodeIt i(g); i!=INVALID; ++i) { - int w=(int)(*(mapstorage.nodemap_storage)[mapname])[i]; + int w=(int)(*actual_map)[i]; if(w>=0) { double x1, y1, x2, y2; - nodesmap[i]->get_bounds(x1, y1, x2, y2); + x1=nodesmap[i]->property_x1().get_value(); + x2=nodesmap[i]->property_x2().get_value(); + y1=nodesmap[i]->property_y1().get_value(); + y2=nodesmap[i]->property_y2().get_value(); nodesmap[i]->property_x1().set_value((x1+x2)/2-w); nodesmap[i]->property_x2().set_value((x1+x2)/2+w); nodesmap[i]->property_y1().set_value((y1+y2)/2-w); @@ -23,11 +36,16 @@ } else { - int w=(int)(*(mapstorage.nodemap_storage)[mapname])[node]; + //I think only new nodes use this case +// int w=(int)(*actual_map)[node]; + int w=(int)(node_property_defaults[N_RADIUS]); if(w>=0) { double x1, y1, x2, y2; - nodesmap[node]->get_bounds(x1, y1, x2, y2); + x1=nodesmap[node]->property_x1().get_value(); + x2=nodesmap[node]->property_x2().get_value(); + y1=nodesmap[node]->property_y1().get_value(); + y2=nodesmap[node]->property_y2().get_value(); nodesmap[node]->property_x1().set_value((x1+x2)/2-w); nodesmap[node]->property_x2().set_value((x1+x2)/2+w); nodesmap[node]->property_y1().set_value((y1+y2)/2-w); @@ -44,17 +62,39 @@ //the minimum of the nodemap to the range of //green in RGB + Graph::NodeMap * actual_map; + if(mapname=="Default") + { + actual_map=new Graph::NodeMap(g,node_property_defaults[N_COLOR]); + } + else + { + actual_map=(mapstorage.nodemap_storage)[mapname]; + } + + double max, min; + + if(mapname!="Default") + { + max=mapstorage.maxOfNodeMap(mapname); + min=mapstorage.minOfNodeMap(mapname); + } + else + { + max=node_property_defaults[N_COLOR]; + min=node_property_defaults[N_COLOR]; + } + + if(node==INVALID) { for (NodeIt i(g); i!=INVALID; ++i) { - double w=(*(mapstorage.nodemap_storage)[mapname])[i]; - double max=mapstorage.maxOfNodeMap(mapname); - double min=mapstorage.minOfNodeMap(mapname); - - //std::cout< * actual_map; + if(mapname=="Default") + { + actual_map=new Graph::NodeMap(g,node_property_defaults[N_COLOR]); + } + else + { + actual_map=(mapstorage.nodemap_storage)[mapname]; + } if(node==INVALID) { for (NodeIt i(g); i!=INVALID; ++i) { - if(mapname!=node_property_strings[N_TEXT]) + if(mapname!="Default") { - double number=(*(mapstorage.nodemap_storage)[mapname])[i]; + double number=(*actual_map)[i]; int length=1; //if number is smaller than one, length would be negative, or invalid if(number>=1) @@ -138,9 +185,9 @@ } else { - if(mapname!=node_property_strings[N_TEXT]) + if(mapname!="Default") { - double number=(*(mapstorage.nodemap_storage)[mapname])[node]; + double number=(*actual_map)[node]; int length=1; //if number is smaller than one, length would be negative, or invalid if(number>=1)