Changeset 31:66e85f44a66f in glemon-0.x for graph_displayer_canvas-edge.cc
- Timestamp:
- 06/29/05 21:44:30 (19 years ago)
- Branch:
- gui
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk/gui@2011
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
graph_displayer_canvas-edge.cc
r28 r31 6 6 int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Graph::Edge edge) 7 7 { 8 Graph::EdgeMap<double> * actual_map; 9 if(mapname=="Default") 10 { 11 actual_map=new Graph::EdgeMap<double>(g,edge_property_defaults[E_WIDTH]); 12 } 13 else 14 { 15 actual_map=(mapstorage.edgemap_storage)[mapname]; 16 } 17 8 18 if(edge==INVALID) 9 19 { 10 20 for (EdgeIt i(g); i!=INVALID; ++i) 11 21 { 12 int w=(int)(* (mapstorage.edgemap_storage)[mapname])[i];22 int w=(int)(*actual_map)[i]; 13 23 if(w>=0) 14 24 { … … 19 29 else 20 30 { 21 int w=(int)(* (mapstorage.edgemap_storage)[mapname])[edge];31 int w=(int)(*actual_map)[edge]; 22 32 if(w>=0) 23 33 { … … 34 44 //the minimum of the nodemap to the range of 35 45 //green in RGB 46 Graph::EdgeMap<double> * actual_map; 47 if(mapname=="Default") 48 { 49 actual_map=new Graph::EdgeMap<double>(g,edge_property_defaults[E_COLOR]); 50 } 51 else 52 { 53 actual_map=(mapstorage.edgemap_storage)[mapname]; 54 } 55 56 double max, min; 57 58 if(mapname!="Default") 59 { 60 max=mapstorage.maxOfEdgeMap(mapname); 61 min=mapstorage.minOfEdgeMap(mapname); 62 } 63 else 64 { 65 max=edge_property_defaults[E_COLOR]; 66 min=edge_property_defaults[E_COLOR]; 67 } 68 36 69 if(edge==INVALID) 37 70 { 38 39 71 for (EdgeIt i(g); i!=INVALID; ++i) 40 72 { 41 double w=(*(mapstorage.edgemap_storage)[mapname])[i]; 42 double max=mapstorage.maxOfEdgeMap(mapname); 43 double min=mapstorage.minOfEdgeMap(mapname); 44 45 //std::cout<<w<<" "<<max<<" "<<min<<" "<<100*(w-min)/(max-min)<<std::endl; 73 double w=(*actual_map)[i]; 74 46 75 Gdk::Color color; 47 76 if(max!=min) … … 53 82 color.set_rgb_p (0, 100, 0); 54 83 } 55 56 84 edgesmap[i]->property_fill_color_gdk().set_value(color); 57 85 } … … 59 87 else 60 88 { 61 double w=(*(mapstorage.edgemap_storage)[mapname])[edge];62 double max=mapstorage.maxOfEdgeMap(mapname);63 double min=mapstorage.minOfEdgeMap(mapname);64 65 //std::cout<<w<<" "<<max<<" "<<min<<" "<<100*(w-min)/(max-min)<<std::endl;66 89 Gdk::Color color; 90 91 double w=(*actual_map)[edge]; 92 67 93 if(max!=min) 68 94 { … … 86 112 //in that case empty string will be written, because 87 113 //that is the deleter map 88 //\todo isn't it a bit woodcutter?89 114 90 115 if(edge==INVALID) … … 92 117 for (EdgeIt i(g); i!=INVALID; ++i) 93 118 { 94 if(mapname!= edge_property_strings[E_TEXT])119 if(mapname!="Default") 95 120 { 96 121 double number=(*(mapstorage.edgemap_storage)[mapname])[i]; … … 129 154 else 130 155 { 131 if(mapname!= edge_property_strings[E_TEXT])156 if(mapname!="Default") 132 157 { 133 158 double number=(*(mapstorage.edgemap_storage)[mapname])[edge];
Note: See TracChangeset
for help on using the changeset viewer.