diff -r b0c76a4d5801 -r e2c86ae158cf graph_displayer_canvas-edge.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graph_displayer_canvas-edge.cc Fri Jun 24 07:58:18 2005 +0000 @@ -0,0 +1,93 @@ +#include +#include +#include + + +int GraphDisplayerCanvas::changeLineWidth (std::string mapname) +{ + for (EdgeIt i(g); i!=INVALID; ++i) + { + int w=(int)(*(mapstorage.edgemap_storage)[mapname])[i]; + if(w>=0) + { + edgesmap[i]->property_width_pixels().set_value(w); + } + } + return 0; +}; + +int GraphDisplayerCanvas::changeColor (std::string mapname) +{ + + //function maps the range of the maximum and + //the minimum of the nodemap to the range of + //green in RGB + + for (EdgeIt i(g); i!=INVALID; ++i) + { + double w=(*(mapstorage.edgemap_storage)[mapname])[i]; + double max=mapstorage.maxOfEdgeMap(mapname); + double min=mapstorage.minOfEdgeMap(mapname); + + //std::cout<property_fill_color_gdk().set_value(color); + } + return 0; +}; + +int GraphDisplayerCanvas::changeText (std::string mapname) +{ + + //the number in the map will be written on the edge + //EXCEPT when the name of the map is Text, because + //in that case empty string will be written, because + //that is the deleter map + //\todo isn't it a bit woodcutter? + + for (EdgeIt i(g); i!=INVALID; ++i) + { + if(mapname!="Text") + { + double number=(*(mapstorage.edgemap_storage)[mapname])[i]; + int length=1; + //if number is smaller than one, length would be negative, or invalid + if(number>=1) + { + length=(int)(floor(log(number)/log(10)))+1; + } + int maxpos=(int)(pow(10,length-1)); + int strl=length+1+RANGE; + char * str=new char[strl]; + str[length]='.'; + str[strl]='\0'; + + for(int j=0;jproperty_text().set_value(str); + } + else + { + edgetextmap[i]->property_text().set_value(""); + } + } + return 0; +};