COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
06/29/05 21:44:30 (15 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2011
Message:

Uh, long comment arrives... Zoom update does not happen after editorial steps. Nodes initial color is light blue, if there is any item under them. Strange node-text relations disappeared. Initial values of new items are given now in a more common way. The wood-cutter way of handling default values of properties is now changed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gui/graph_displayer_canvas-edge.cc

    r1512 r1525  
    66int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Graph::Edge edge)
    77{
     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
    818  if(edge==INVALID)
    919    {
    1020      for (EdgeIt i(g); i!=INVALID; ++i)
    1121        {
    12           int w=(int)(*(mapstorage.edgemap_storage)[mapname])[i];
     22          int w=(int)(*actual_map)[i];
    1323          if(w>=0)
    1424            {
     
    1929  else
    2030    {
    21       int w=(int)(*(mapstorage.edgemap_storage)[mapname])[edge];
     31      int w=(int)(*actual_map)[edge];
    2232      if(w>=0)
    2333        {
     
    3444  //the minimum of the nodemap to the range of
    3545  //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
    3669  if(edge==INVALID)
    3770    {
    38 
    3971      for (EdgeIt i(g); i!=INVALID; ++i)
    4072        {
    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
    4675          Gdk::Color color;
    4776          if(max!=min)
     
    5382              color.set_rgb_p (0, 100, 0);
    5483            }
    55 
    5684          edgesmap[i]->property_fill_color_gdk().set_value(color);
    5785        }
     
    5987  else
    6088    {
    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;
    6689      Gdk::Color color;
     90
     91      double w=(*actual_map)[edge];
     92
    6793      if(max!=min)
    6894        {
     
    86112  //in that case empty string will be written, because
    87113  //that is the deleter map
    88   //\todo isn't it a bit woodcutter?
    89114
    90115  if(edge==INVALID)
     
    92117      for (EdgeIt i(g); i!=INVALID; ++i)
    93118        {
    94           if(mapname!=edge_property_strings[E_TEXT])
     119          if(mapname!="Default")
    95120            {
    96121              double number=(*(mapstorage.edgemap_storage)[mapname])[i];
     
    129154  else
    130155    {
    131       if(mapname!=edge_property_strings[E_TEXT])
     156      if(mapname!="Default")
    132157        {
    133158          double number=(*(mapstorage.edgemap_storage)[mapname])[edge];
Note: See TracChangeset for help on using the changeset viewer.