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