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