Changeset 1596:44897b1ba4e2 in lemon0.x for gui/graph_displayer_canvasedge.cc
 Timestamp:
 07/27/05 13:19:35 (16 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2100
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

gui/graph_displayer_canvasedge.cc
r1595 r1596 120 120 edgemap_to_edit=mapname; 121 121 double number=(*(mapstorage.edgemap_storage)[mapname])[i]; 122 // int length=1;123 // //if number is smaller than one, length would be negative, or invalid124 // if(number>=1)125 // {126 // length=(int)(floor(log(number)/log(10)))+1;127 // }128 // int maxpos=(int)(pow(10,length1));129 // int strl=length+1+RANGE;130 // char * str=new char[strl];131 // str[length]='.';132 // str[strl]='\0';133 134 // for(int j=0;j<strl;j++)135 // {136 // if(j!=length)137 // {138 // if((number(int)number)>ALMOST_ONE)139 // {140 // number=round(number);141 // }142 // int digit=(int)(number/maxpos);143 // str[j]=(digit+'0');144 // number=digit*maxpos;145 // number*=10;146 // }147 // }148 // edgetextmap[i]>property_text().set_value(str);149 122 150 123 std::ostringstream ostr; 151 124 ostr << number; 152 125 153 126 edgetextmap[i]>property_text().set_value(ostr.str()); 154 127 } … … 166 139 { 167 140 double number=(*(mapstorage.edgemap_storage)[mapname])[edge]; 168 int length=1; 169 //if number is smaller than one, length would be negative, or invalid 170 if(number>=1) 171 { 172 length=(int)(floor(log(number)/log(10)))+1; 173 } 174 int maxpos=(int)(pow(10,length1)); 175 int strl=length+1+RANGE; 176 char * str=new char[strl]; 177 str[length]='.'; 178 str[strl]='\0'; 179 180 for(int j=0;j<strl;j++) 181 { 182 if(j!=length) 183 { 184 if((number(int)number)>ALMOST_ONE) 185 { 186 number=round(number); 187 } 188 int digit=(int)(number/maxpos); 189 str[j]=(digit+'0'); 190 number=digit*maxpos; 191 number*=10; 192 } 193 } 194 195 edgetextmap[edge]>property_text().set_value(str); 141 142 std::ostringstream ostr; 143 ostr << number; 144 145 edgetextmap[edge]>property_text().set_value(ostr.str()); 196 146 } 197 147 else
Note: See TracChangeset
for help on using the changeset viewer.