#include #include #include int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Graph::Edge edge) { if(edge==INVALID) { 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); } } } else { int w=(int)(*(mapstorage.edgemap_storage)[mapname])[edge]; if(w>=0) { edgesmap[edge]->property_width_pixels().set_value(w); } } return 0; }; int GraphDisplayerCanvas::changeEdgeColor (std::string mapname, Graph::Edge edge) { //function maps the range of the maximum and //the minimum of the nodemap to the range of //green in RGB if(edge==INVALID) { 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); } } else { double w=(*(mapstorage.edgemap_storage)[mapname])[edge]; double max=mapstorage.maxOfEdgeMap(mapname); double min=mapstorage.minOfEdgeMap(mapname); //std::cout<property_fill_color_gdk().set_value(color); } return 0; }; int GraphDisplayerCanvas::changeEdgeText (std::string mapname, Graph::Edge edge) { //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? if(edge==INVALID) { for (EdgeIt i(g); i!=INVALID; ++i) { if(mapname!=edge_property_strings[E_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(""); } } } else { if(mapname!=edge_property_strings[E_TEXT]) { double number=(*(mapstorage.edgemap_storage)[mapname])[edge]; 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[edge]->property_text().set_value(""); } } return 0; };