COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
08/23/05 17:57:12 (19 years ago)
Author:
Akos Ladanyi
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2159
Message:
  • handle the case when there is no id map in the edgeset section
  • do not use ListGraph?.id() to determine the id of a new node/edge
File:
1 edited

Legend:

Unmodified
Added
Removed
  • gui/graph_displayer_canvas-event.cc

    r1645 r1646  
    241241      mapstorage.coords.set(active_node, xy<double>(clicked_x, clicked_y));
    242242
    243       // update id map
    244       (*mapstorage.nodemap_storage["id"])[active_node] =
    245         mapstorage.graph.id(active_node);
    246 
    247243      // update all other maps
    248244      for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
     
    250246          mapstorage.nodemap_storage.end(); ++it)
    251247      {
    252         if ((it->first != "id") &&
    253             (it->first != "coordinates_x") &&
    254             (it->first != "coordiantes_y"))
     248        if ((it->first != "coordinates_x") &&
     249            (it->first != "coordinates_y"))
    255250        {
    256251          (*(it->second))[active_node] =
     
    258253        }
    259254      }
     255      // increment the id map's default value
     256      mapstorage.nodemap_default["id"] += 1.0;
    260257
    261258      nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph,
     
    357354                  target_node);
    358355
    359               // update id map
    360               (*mapstorage.edgemap_storage["id"])[active_edge] =
    361                 mapstorage.graph.id(active_edge);
    362  
    363               // update all other maps
     356              // update maps
    364357              for (std::map<std::string,
    365358                  Graph::EdgeMap<double>*>::const_iterator it =
     
    367360                  mapstorage.edgemap_storage.end(); ++it)
    368361              {
    369                 if (it->first != "id")
    370                 {
    371                   (*(it->second))[active_edge] =
    372                     mapstorage.edgemap_default[it->first];
    373                 }
     362                (*(it->second))[active_edge] =
     363                  mapstorage.edgemap_default[it->first];
    374364              }
     365              // increment the id map's default value
     366              mapstorage.edgemap_default["id"] += 1.0;
    375367
    376368              //calculating coordinates of new edge
Note: See TracChangeset for help on using the changeset viewer.