COIN-OR::LEMON - Graph Library

Changeset 1525:6d94de269ab1 in lemon-0.x for gui/map_win.cc


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/map_win.cc

    r1524 r1525  
    2424  for(int i=0;i<EDGE_PROPERTY_NUM;i++)
    2525  {
    26 
    27     std::map< std::string,Graph::EdgeMap<double> * >::iterator emsi=ms.beginOfEdgeMaps();
    28     std::set<int> props;
    29 
    30     int actprop;
    31 
    32     //here we find out, which map is the default in MapStorage for this property, which are not
    33     for(int j=0;j<ms.numOfEdgeMaps();j++)
    34     {
    35       //this is the default value for this property
    36       if(emsi->second==&(ms.default_edgemaps[i]))
    37       {
    38         actprop=j;
    39       }
    40       //these are the maps NOT to show for this property
    41       for(int k=0;k<EDGE_PROPERTY_NUM;k++)
    42       {
    43         if(emsi->second==&(ms.default_edgemaps[k]))
    44         {
    45           props.insert(j);
    46         }
    47       }
    48       emsi++;
    49     }
    50 
    5126    //filling in combo box with choices
    5227    std::list<Glib::ustring> listStrings;
     
    5429    listStrings.push_back("Default");
    5530
    56     emsi=ms.beginOfEdgeMaps();
    57 
    58     for(int j=0;j<ms.numOfEdgeMaps();j++)
    59     {
    60       if( ( props.find(j) )==( props.end() ) )
    61       {
     31    std::map< std::string,Graph::EdgeMap<double> * >::iterator emsi=ms.beginOfEdgeMaps();
     32    for(;emsi!=ms.endOfEdgeMaps();emsi++)
     33    {
    6234        listStrings.push_back(emsi->first);
    63       }
    64       emsi++;
    6535    }
    6636
     
    10373  for(int i=0;i<NODE_PROPERTY_NUM;i++)
    10474  {
    105 
    106     std::map< std::string,Graph::NodeMap<double> * >::iterator emsi=ms.beginOfNodeMaps();
    107     std::set<int> props;
    108 
    109     int actprop;
    110 
    111     //here we find out, which map is the default in MapStorage for this property, which are not
    112     for(int j=0;j<ms.numOfNodeMaps();j++)
    113     {
    114       //these are the maps NOT to show for this property
    115       if(emsi->second==&(ms.default_nodemaps[i]))
    116       {
    117         actprop=j;
    118       }
    119       //this is the other maps to show for this property
    120       for(int k=0;k<NODE_PROPERTY_NUM;k++)
    121       {
    122         if(emsi->second==&(ms.default_nodemaps[k]))
    123         {
    124           props.insert(j);
    125         }
    126       }
    127       emsi++;
    128     }
    129 
    13075    //filling in combo box with choices
    13176    std::list<Glib::ustring> listStrings;
     
    13378    listStrings.push_back("Default");
    13479
    135     emsi=ms.beginOfNodeMaps();
    136 
    137     for(int j=0;j<ms.numOfNodeMaps();j++)
    138     {
    139       if( ( props.find(j) )==( props.end() ) )
    140       {
    141         listStrings.push_back(emsi->first);
    142       }
    143       emsi++;
     80    std::map< std::string,Graph::NodeMap<double> * >::iterator emsi=ms.beginOfNodeMaps();
     81
     82    for(;emsi!=ms.endOfNodeMaps();emsi++)
     83    {
     84      listStrings.push_back(emsi->first);
    14485    }
    14586
     
    189130    if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty.
    190131    {
    191       if(mapname=="Default")
    192       {
    193         mapname=edge_property_strings[prop];
    194       }
    195 
    196       if( (ms.edgemap_storage).find(mapname) != (ms.edgemap_storage).end() )
     132      if( ( (ms.edgemap_storage).find(mapname) != (ms.edgemap_storage).end() ) || (mapname=="Default") )
    197133      {
    198134        switch(prop)
     
    225161    if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty.
    226162    {
    227       if(mapname=="Default")
    228       {
    229         mapname=node_property_strings[prop];
    230       }
    231 
    232       if( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() )
     163      if( ( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() ) || (mapname=="Default") )
    233164      {
    234165        switch(prop)
     
    262193          if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty.
    263194            {
    264               if(mapname=="Default")
    265                 {
    266                   mapname=node_property_strings[i];
    267                 }
    268 
    269               if( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() )
     195              if( ( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() ) || (mapname=="Default") )
    270196                {
    271197                  switch(i)
    272198                    {
    273199                    case N_RADIUS:
    274                       //gdc.changeNodeRadius(mapname, node);
    275                       std::cout << "If default map-value problem is solved, uncomment line in MapWin::node_update!" << std::endl;
     200                      gdc.changeNodeRadius(mapname, node);
    276201                      break;
    277202                    case N_COLOR:
     
    302227          if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty.
    303228            {
    304               if(mapname=="Default")
    305                 {
    306                   mapname=edge_property_strings[i];
    307                 }
    308 
    309               if( (ms.edgemap_storage).find(mapname) != (ms.edgemap_storage).end() )
     229
     230              if( ( (ms.edgemap_storage).find(mapname) != (ms.edgemap_storage).end() ) || (mapname=="Default") )
    310231                {
    311232                  switch(i)
    312233                    {
    313234                    case E_WIDTH:
    314                       //gdc.changeEdgeWidth(mapname, edge);
    315                       std::cout << "If default map-value problem is solved, uncomment line in MapWin::edge_update!" << std::endl;
     235                      gdc.changeEdgeWidth(mapname, edge);
    316236                      break;
    317237                    case E_COLOR:
Note: See TracChangeset for help on using the changeset viewer.