COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
07/28/05 17:54:00 (19 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2104
Message:

cout->cerr, node radius and edge width is now scaled, maps are editable by clicking on texts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gui/graph_displayer_canvas-edge.cc

    r1598 r1599  
    77{
    88  Graph::EdgeMap<double> * actual_map;
     9  double min, max;
     10
    911  if(mapname=="Default")
    1012    {
     13      min=edge_property_defaults[E_WIDTH];
     14      max=edge_property_defaults[E_WIDTH];
    1115      actual_map=new Graph::EdgeMap<double>(g,edge_property_defaults[E_WIDTH]);
    1216    }
    1317  else
    1418    {
     19      min=mapstorage.minOfEdgeMap(mapname);
     20      max=mapstorage.maxOfEdgeMap(mapname);
    1521      actual_map=(mapstorage.edgemap_storage)[mapname];
    1622    }
     
    2026      for (EdgeIt i(g); i!=INVALID; ++i)
    2127        {
    22           int w=(int)(*actual_map)[i];
    23           if(w>=0)
     28          double v=abs((*actual_map)[i]);
     29          int w;
     30          if(min==max)
    2431            {
    25               edgesmap[i]->property_width_units().set_value(w);
     32              w=(int)(edge_property_defaults[E_WIDTH]);
    2633            }
     34          else
     35            {
     36              w=(int)(MIN_EDGE_WIDTH+(v-min)/(max-min)*(MAX_EDGE_WIDTH-MIN_EDGE_WIDTH));
     37            }
     38          edgesmap[i]->property_width_units().set_value(w);
    2739        }
    2840    }
Note: See TracChangeset for help on using the changeset viewer.